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.
-
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.
-
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. -
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. -
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
-
Deploy DaemonSet Deploy the DaemonSet that runs lm_sensors:
kubectl apply -f deploymentfiles/daemonset.yaml
-
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.
Please notice settings such as privileged
container settings and storage sizes in the PVC and adjust as needed.
Running containers with privileged
access can pose security risks. Be cautious where and how you use such configurations.