3.1 Monitor Cluster Components (Metrics Server)
Kubernetes does not ship with a full monitoring stack by default, but it provides a resource metrics pipeline that lets you quickly check CPU and memory usage of nodes and pods using Metrics Server.
🎯 What You Monitor in a Kubernetes Cluster
At a minimum, you should be able to see:
- Number of nodes
- Node health status
- Node CPU & memory usage
- Pod CPU & memory usage
- Which workloads are consuming resources
Note
Built‑in metrics are current usage only. Historical graphs require tools like Prometheus or commercial monitoring platforms.
🧩 Monitoring Tool Options
Common solutions:
- Metrics Server → lightweight, real‑time usage
- Prometheus → full metrics + history
- Elastic Stack → logs + metrics
- Datadog / Dynatrace → managed monitoring
Tip
For CKA/CKAD exams and quick troubleshooting, Metrics Server + kubectl top is what you must know.
📦 What is Metrics Server
Metrics Server is a cluster add‑on that:
- Collects CPU & memory metrics
- Reads metrics from kubelets
- Aggregates node & pod usage
- Stores data in memory only
- Powers
kubectl topcommands
Warning
Metrics Server is not for long‑term storage or dashboards.
⚙️ How Metrics Are Collected
Metrics flow inside the cluster like this:
Step by step:
- Containers generate usage data
- cAdvisor inside kubelet reads container stats
- kubelet exposes metrics API
- Metrics Server pulls metrics
kubectl topdisplays results
Abstract
kubelet + cAdvisor = metric source, Metrics Server = metric aggregator.
User commands:
These commands query Metrics Server — not kubelet directly.
🚀 Install Metrics Server
📊 View Node Metrics
Example:
Shows:
- CPU in millicores
- Memory usage
- Current load
📊 View Pod Metrics
Example:
Example
Quickly identify high‑usage pods.
🧠 Exam Facts
Question
Does Metrics Server store history?
No — memory only.
Question
How many Metrics Servers per cluster?
Exactly one.
⚠️ If Metrics Are Missing
If you see:
Check:
- Metrics Server pod running
- Deployment healthy
- Wait after install
- kubelet TLS settings compatible
✅ Quick Summary
Summary
- Metrics Server gives live CPU/memory metrics
- Uses kubelet + cAdvisor data
- No historical storage
- Enables kubectl top commands
- Install via addon or manifests
- Required knowledge for exams