By Kevin McAleer, 5 Minutes
Page last updated November 24, 2026

By the end of this lesson you will be able to check the CPU and memory use of your nodes and pods, and look at your cluster in a graphical or terminal dashboard.
A Pi has very little memory to spare, so you want to know early when a pod is hungry. Monitoring comes in layers, from a quick command to a full dashboard:
flowchart LR
M["metrics-server<br/>bundled with K3s"] --> T["kubectl top"]
M --> H["Headlamp dashboard"]
API["Kubernetes API"] --> H
API --> K["k9s terminal UI"]
K3s bundles metrics-server, so you do not need to install it. It collects CPU and memory use from every node, and kubectl top reads it:
kubectl top nodes
kubectl top pods -A
You should get a table of CPU (in millicores, where 1000m is one core) and memory per node, then per pod. If it says metrics are not available yet, wait a minute after the cluster starts and try again. Look for the node using the most memory: on a 2GB Pi that is the one to watch.
k9s is a popular terminal UI that lists pods, shows logs and lets you jump around with the keyboard. It runs on your computer and uses the same kubeconfig as kubectl. Install it by following the instructions on the k9s project page (k9scli.io) for your system, then run:
k9s
Type :nodes or :pods to switch view, l to see logs for a pod, and q or Ctrl+C to exit. It is a lot like a task manager for Kubernetes.
You may see older guides installing the Kubernetes Dashboard. The Kubernetes project has retired that dashboard and points people to Headlamp instead, so that is what we use.
There are two ways to run it. The first needs nothing on the cluster:
Headlamp desktop app. Download it from headlamp.dev, install it on your computer, and open it. It uses your existing kubeconfig (the file you set up in lesson 8) to show your cluster: nodes, pods, logs and more.
Headlamp inside the cluster. This needs Helm, which we cover in lesson 13, so come back to this part afterwards if you like. The Headlamp docs give these commands:
helm repo add headlamp https://kubernetes-sigs.github.io/headlamp/
helm install headlamp headlamp/headlamp --namespace kube-system
The in-cluster Headlamp logs in with a service account token. Create an account for it and give it permissions. Granting cluster-admin is the simplest, and also the most powerful, so only do this on a cluster that is yours:
kubectl -n kube-system create serviceaccount headlamp-admin
kubectl create clusterrolebinding headlamp-admin --serviceaccount=kube-system:headlamp-admin --clusterrole=cluster-admin
kubectl create token headlamp-admin -n kube-system
The last command prints a token to paste into the login page. Then reach the dashboard with a port-forward (check the service name with kubectl get svc -n kube-system):
kubectl port-forward -n kube-system service/headlamp 8080:80
Open http://localhost:8080 and paste the token. If the pod does not start, check kubectl describe pod for an image or architecture error.
Once you have a view, try these:
Teachers: A token with
cluster-admincan do anything, including delete the whole cluster. In a class, create read-only access for learners, or keep the admin token with the teacher and demonstrate on a projector. Do not leave a dashboard port exposed on the school network.
kubectl top nodes and note the memory use of each Pi.kubectl top pods again. What changed?kube-system, and work out whether you could disable it. Hint: K3s has --disable options for bundled components.kubectl top says Metrics API not available.kubectl get pods -n kube-system for a running metrics-server pod.Why: Metrics need a short time to be collected after the cluster starts.
kubectl create token headlamp-admin -n kube-system and paste all of it.Why: Tokens made this way expire after a time, and one with a missing character fails.
port-forward says the service is not found.kubectl get svc -n kube-system and use the real service name.Quick quiz 1 of 3
Which component provides the data for kubectl top?
kubectl top queries.Quick quiz 2 of 3
What do you need to run the Headlamp desktop app against your cluster?
Quick quiz 3 of 3
Why be careful with a cluster-admin token?
Comments