- Run cAdvisor Daemonset which K8s deploys the cAdvisor on every node in cluster
kubectl create -f https://raw.githubusercontent.com/veerendra2/prometheus-k8s-monitoring/master/cadvisor-daemonset.yml
- Run Prometheus Configmap which provides config for prometheus server. If nessasary edit the config and run
kubectl create -f https://raw.githubusercontent.com/veerendra2/prometheus-k8s-monitoring/master/prometheus-configmap.yml
- Apply RBAC
kubectl apply -f https://raw.githubusercontent.com/veerendra2/prometheus-k8s-monitoring/master/prometheus-rbac.yml
- Now create
Deployment
which K8s creates Prometheus POD, Service with a NodePort30900
kubectl create -f https://raw.githubusercontent.com/veerendra2/prometheus-k8s-monitoring/master/prometheus-deployment.yml
- Open TCP port 30900 on any node in the cluster.
- Access the Prometheus UI
http://<NODE IP>:30900
-
I have relabeled
__meta_kubernetes_pod_name
tocontainer_label_io_kubernetes_pod_name
and__meta_kubernetes_namespace
tocontainer_label_io_kubernetes_pod_namespace
which look likecAdvisor
's metric tag. So carefull it will addexported_
for those two metrics likeexported_container_label_io_kubernetes_pod_namespace
andexported_container_label_io_kubernetes_pod_name
-
run.sh - https://raw.githubusercontent.com/veerendra2/prometheus-k8s-monitoring/master/run.sh
-
kill.sh - https://raw.githubusercontent.com/veerendra2/prometheus-k8s-monitoring/master/kill.sh