Kubernetes interview question · Most asked
How do you monitor a Kubernetes cluster and the applications on it?
Summary
Collect metrics with Prometheus (kube-state-metrics for object state, node exporter for nodes, cAdvisor via kubelet for containers, and application metrics), visualise and alert with Grafana and Alertmanager, ship logs with a DaemonSet agent (Fluent Bit, Vector, OpenTelemetry Collector) to a log store, and add tracing with OpenTelemetry.
Longer Answer
Alert on what matters: application SLOs first, then platform signals such as pods crash-looping, deployments not progressing, nodes not ready, persistent volume space, certificate expiry, CPU throttling, OOM kills, and the control plane (API latency, etcd). Watch metric cardinality: labels such as pod name multiply series. Managed options exist on every cloud (Amazon Managed Prometheus, Google Managed Prometheus, Grafana Cloud).
Key Points
- Prometheus + kube-state-metrics + node exporter.
- Logs via DaemonSet agents.
- Tracing with OpenTelemetry.
- Alert on SLOs first, then platform signals.
Deep dive: Observability and Operations
More most-asked Kubernetes questions
- ConfigMaps and Secrets: how do they differ, and how should secrets really be handled?
- How does the scheduler place pods? Explain resource requests, node affinity, taints and tolerations.
- Describe the Kubernetes architecture: what runs on the control plane and what runs on the nodes?
- How do rolling updates work in a Deployment, and how do you roll back?
- Explain the Service types: ClusterIP, NodePort, LoadBalancer, ExternalName and headless.
- What happens, step by step, when you run kubectl apply for a Deployment?
- Deployment, StatefulSet, DaemonSet, Job and CronJob: when do you use each?
- What is the difference between resource requests and limits, and what are the QoS classes?