Skip to main content
In this lesson you’ll learn how to monitor Kubernetes cluster components using the Kubernetes Metrics Server. We’ll:
  • Inspect running pods.
  • Deploy a lab-ready Metrics Server instance from the provided repository.
  • Use kubectl top to view node and pod resource consumption and answer a few basic monitoring questions.
Prerequisites: a working kubeconfig and cluster access where you can create cluster-scoped resources.

1. Inspect the currently deployed pods

Start by listing the pods to confirm the workloads we will monitor:
We need the Metrics Server to collect and expose CPU and memory metrics for nodes and pods so that kubectl top can display them.
Do not use the lab-provided manifests as-is in production. These manifests include modifications tailored to the lab environment. Always consult the official Metrics Server documentation and adapt configuration for production deployments.
Always refer to the Metrics Server project for up-to-date guidance and production deployment options.
A dark‑mode GitHub repository page for a "kubernetes-metrics-server" project showing a list of YAML files (metrics-server, auth-reader, etc.) and a README. The right side shows repo metadata like stars, forks, releases and contributor avatars.

2. Clone the lab repository and create the resources

Clone the prepared repository (contains manifests adjusted for the lab) and apply all manifests in the directory:
After creating the Metrics Server objects it can take a short while for the server to start scraping metrics and for metrics to become available. Give it a minute or two and retry the kubectl top commands if they initially return errors.

3. Verify metrics with kubectl top

When the Metrics Server is ready, use the following commands to inspect node and pod resource usage. Example output for nodes:
Example output for pods:

4. Answering the lab questions

Use the kubectl top outputs above to determine which node and pod consume the most/least resources.

5. Additional references

This covers deploying the Metrics Server for the lab and using kubectl top nodes and kubectl top pods to identify basic resource consumption.

Watch Video