Interview Prep/Monitoring & Observability/Grafana, Dashboards and Kubernetes Monitoring

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 →

  1. 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".
  2. 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".
  3. metrics-server: short-term CPU/memory for kubectl top and HPA; not for Prometheus history.

Why → Usage, state, and autoscaling input are separate concerns.

Interview tip → "metrics-server is for autoscaling, not monitoring."

All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Grafana, Dashboards and Kubernetes Monitoring