- Detect node failures and resource exhaustion early
- Understand pod-level resource usage for troubleshooting and sizing
- Drive autoscaling decisions (HPA/VPA)
- Retain historical metrics when performing capacity planning or trend analysis
What to monitor
Monitoring solutions overview
Kubernetes does not include a full-featured monitoring system out of the box. Common open-source and commercial solutions include:- Metrics Server — lightweight metrics source used by
kubectl topand autoscalers - Prometheus — long-term time series storage, alerting and advanced querying
- EFK/ELK Stack — logging and log-based insights
- Commercial SaaS — Datadog, Dynatrace, etc.


Metrics Server — lightweight cluster metrics
Metrics Server is the modern, lightweight replacement for Heapster. It provides the Kubernetes Metrics API used bykubectl top and autoscalers (Horizontal Pod Autoscaler).
Key facts about Metrics Server:
- Typically one Metrics Server instance per cluster.
- Scrapes metrics from each node’s kubelet Summary API (which surfaces cAdvisor stats).
- Aggregates metrics in memory and serves them via the Kubernetes metrics API.
- Does not persist metrics to disk or provide long-term historical storage — for that use Prometheus or another time-series store.
Metrics Server provides live metrics for
kubectl and autoscalers, but it is not a long-term metrics store. Use Prometheus or a dedicated monitoring stack for historical metrics and advanced queries.How pod and node metrics are produced
- Each node runs a kubelet that manages pods and communicates with the control plane.
- The kubelet exposes node and container statistics (cAdvisor functionality) through the Summary API and other endpoints.
- Metrics Server polls the kubelet Summary API on each node to collect node- and pod-level metrics and exposes them via the Kubernetes Metrics API.

Deploying Metrics Server
Minikube:- Clone or download the Metrics Server repository:
- Apply the upstream manifests (path may change; check the repo for the current location):
Viewing live metrics
Usekubectl top to query live metrics from Metrics Server.
Commands:
Example:
- If
kubectl topshows no data, confirm Metrics Server pods are running and check their logs (kubectl -n kube-system get podsandkubectl logs ...). - Ensure kubelet Summary API endpoints are reachable from the Metrics Server (network policies, firewalls, or RBAC can block access).
- Metrics Server does not store historical data—if you need historical metrics, integrate Prometheus or another TSDB.
When to use Prometheus or a full monitoring stack
If you require:- Long-term historical metrics and retention
- Advanced querying with PromQL or complex dashboards
- Alerting and recording rules
- Integration with Grafana or log/trace correlation
Links and references
- Metrics Server repository: https://github.com/kubernetes-sigs/metrics-server
- Prometheus (Kubernetes monitoring): https://learn.kodekloud.com/user/courses/prometheus-certified-associate-pca
- EFK Stack: https://learn.kodekloud.com/user/courses/efk-stack-enterprise-grade-logging-and-monitoring
- Datadog: https://www.datadoghq.com/
- Dynatrace: https://www.dynatrace.com/
- Kubernetes concepts: https://kubernetes.io/docs/concepts/