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