kube-state-metrics vs metrics-server vs cAdvisor: a junior engineer is confused. Explain with a scenario.
BeginnerScenarioGrafana, Dashboards and Kubernetes Monitoring
Answer
Situation read → All three provide "Kubernetes metrics" but serve different purposes.
What I'd do →
- cAdvisor (inside kubelet): actual resource usage per container, e.g.
container_cpu_usage_seconds_total. Use it for "how much CPU is the pod using". - kube-state-metrics: object state from the API, e.g.
kube_deployment_status_replicas_available,kube_pod_status_phase. Use it for "how many replicas are unavailable". - metrics-server: short-term CPU/memory for
kubectl topand HPA; not for Prometheus history.
Why → Usage, state, and autoscaling input are separate concerns.
Interview tip → "metrics-server is for autoscaling, not monitoring."
More on Grafana, Dashboards and Kubernetes Monitoring
Grafana has 900 dashboards and nobody can find anything. How do you clean it up?IntermediateHow do you manage Grafana dashboards as code?IntermediateDesign a service overview dashboard that an on-call engineer can read in 10 seconds.BeginnerYou need to show deploy events on every Grafana graph. How?BeginnerPods are being OOMKilled but the memory graph never reaches the limit. Why?IntermediateHow do you detect CPU throttling hurting latency in Kubernetes?Intermediate