A comprehensive Home Assistant integration for monitoring and controlling Kubernetes clusters. Monitor your cluster's health and control workloads directly from Home Assistant.
- 🔍 Cluster Monitoring: Monitor pods, nodes, deployments, statefulsets, and cronjobs across your Kubernetes cluster
- �️ Individual Node Monitoring: Detailed sensors for each node showing status, IP addresses, memory/CPU resources, and system information
- �📁 Multi-Namespace Support: Monitor a single namespace or all namespaces in your cluster
- 🎛️ Workload Control: Scale, start, and stop deployments and statefulsets directly from Home Assistant
- ⏰ CronJob Management: Control CronJob suspension state via switches and trigger jobs manually via service calls
- 🔄 Robust Connectivity: Automatic fallback from kubernetes Python client to aiohttp for reliable API communication
- 🛡️ Advanced State Management: Intelligent polling and state recovery for reliable operation
- 🔧 Dynamic Entity Management: Automatic entity creation and cleanup as cluster resources change
- Ensure HACS is installed
- Search for "Kubernetes" and install
- Restart Home Assistant
- Copy
custom_components/kubernetesto yourconfig/custom_components/directory - Restart Home Assistant
-
Configure Kubernetes Service Account:
# Apply the required manifests kubectl apply -f https://raw.githubusercontent.com/tibuntu/homeassistant-kubernetes/refs/heads/main/manifests/serviceaccount.yaml kubectl apply -f https://raw.githubusercontent.com/tibuntu/homeassistant-kubernetes/refs/heads/main/manifests/clusterrole.yaml kubectl apply -f https://raw.githubusercontent.com/tibuntu/homeassistant-kubernetes/refs/heads/main/manifests/clusterrolebinding.yaml kubectl apply -f https://raw.githubusercontent.com/tibuntu/homeassistant-kubernetes/refs/heads/main/manifests/serviceaccount-token-secret.yaml # Extract the token kubectl get secret homeassistant-kubernetes-integration-token -n homeassistant -o jsonpath='{.data.token}' | base64 -d
-
Add Integration:
- Go to Settings → Devices & Services
- Add "Kubernetes" integration
- Enter your cluster details and the token from step 1
-
Start Monitoring: The integration will automatically discover and create entities for your deployments, statefulsets, cronjobs, individual nodes, and cluster metrics.
For comprehensive documentation, visit the Mkdocs site.
Contributions are welcome! Please feel free to submit a Pull Request.
For development information, see the Development Guide.
This project is licensed under the MIT License - see the LICENSE file for details.