Skip to content

A basic container image with lmsensors. The container hosts a script that runs lmsensors every 60 seconds and ouputs it to a html file.

License

Notifications You must be signed in to change notification settings

MichaelTrip/lmsensors-container

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Author

Docker lmsensors-container build status GitHub License GitHub last commit

LMSensors DaemonSet and Web Server with GitHub Actions pipeline.

This repository contains the manifests for a Kubernetes DaemonSet that runs the lm_sensors command every minute on each node, a web server Deployment displaying the output of those commands, as well as a GitHub Actions pipeline for continuous integration and deployment. The webserver contains a custom index.html (in a configmap) that loads the text files from lmsensor. Make sure to adapt the configmap and add your node names and filenames to it. See the webserver.yaml for more information.

Instructions:

  1. Build and Push Docker Image with Github Actions The GitHub Actions pipeline is preconfigured to automatically build the Docker image described in the repo's Dockerfile whenever there are new changes pushed to the repository. The image will then be pushed to your Docker Registry.

  2. Customize GitHub Actions Pipeline Update the GitHub Actions workflow file .github/workflows/main.yml, replacing placeholder values with your real ones where needed. This includes Docker Registry, Kubernetes cluster access details, etc.

  3. Update the Kubernetes Manifests Replace the lmsensors:latest Docker image URI in your Kubernetes manifests (the DaemonSet and Deployment) with the actual Docker image URI.

  4. Deploy PersistentVolumeClaim (PVC) Apply the PVC configuration for data to be persisted on the node:

    kubectl apply -f deploymentfiles/pvc.yaml

    Make sure this pvc is ReadWriteMany

  5. Deploy DaemonSet Deploy the DaemonSet that runs lm_sensors: kubectl apply -f deploymentfiles/daemonset.yaml

  6. Deploy Web Server Deploy the web server Deployment that reads from the shared volume: kubectl apply -f deploymentfiles/webserver.yaml

    This will deploy the webserver and a service with type LoadBalancer

After all components are deployed, the LoadBalancer will expose an IP address from which you can access the lm_sensors output on the web server.

Screenshot

screenshot

Note

Please notice settings such as privileged container settings and storage sizes in the PVC and adjust as needed.

Caution

Running containers with privileged access can pose security risks. Be cautious where and how you use such configurations.

About

A basic container image with lmsensors. The container hosts a script that runs lmsensors every 60 seconds and ouputs it to a html file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages