Skip to main content

View metrics

You query the current utilisation of your cluster with kubectl top. This requires the metrics-server, which you install with a single command. For historical data and custom dashboards, see Advanced metrics.

Prerequisites​

1. Install metrics-server​

Check whether the metrics-server is already running:

kubectl get deployment metrics-server -n kube-system

If it is missing, install it:

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml

It delivers data after about one minute.

2. Query utilisation​

# Utilisation per node
kubectl top nodes

# Utilisation per pod across all namespaces
kubectl top pods -A

# Pods with the highest CPU load first
kubectl top pods -A --sort-by=cpu

These commands return snapshots, not a history over time.

3. Check reserved capacity​

Whether further pods fit on a node does not depend on actual utilisation but on the requested requests:

kubectl describe node <node-name>

The Allocated resources section shows the sum of the requests and limits of all pods on the node.

Interpret the values​

  • High CPU load: Short spikes are not critical. Sustained utilisation close to the limit calls for larger nodes or more nodes in the pool.
  • Memory at the limit: Memory cannot be compressed. If a container reaches its limit, Kubernetes terminates it (OOMKilled). Keep a deliberate reserve.
  • Pods stay Pending despite low utilisation: Check the requests you have set. Values that are too high block capacity that is not actually used.