kubectl top nodes shows error metrics not available yet
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
In Kubernetes, monitoring resources like CPU and memory usage is essential for the smooth operation and scaling of applications. The kubectl top
command provides a quick way to get a snapshot of resource usage for nodes and pods. However, a common issue that many users face is the metrics not available yet
error, particularly when executing kubectl top nodes
. This article delves into the possible causes of this error and provides solutions to remedy it.
Understanding the metrics not available yet
Error
When you run kubectl top nodes
, Kubernetes attempts to fetch CPU and memory usage metrics via the Metrics Server. The error message, metrics not available yet
, indicates that the Metrics Server is unable to retrieve the required data. This can occur for several reasons:
- Metrics Server Not Installed: The Metrics Server is a critical component for gathering metrics. Some Kubernetes distributions do not come with the Metrics Server pre-installed.
- Metrics Server Not Running: If the Metrics Server is installed but not running, perhaps due to a crash or misconfiguration, it will be unable to provide metrics.
- Network Policies or Firewalls: Network configurations can prevent the Metrics Server from collecting data, often due to firewalls or network policies blocking the required communication paths.
- RBAC (Role-Based Access Control) Misconfigurations: Inadequate permissions can prevent the Metrics Server from accessing necessary data, resulting in this error message.
- Node or API Server Issues: Problems with the nodes or the Kubernetes API server may impede the Metrics Server’s ability to retrieve or relay data.
Troubleshooting Steps
1. Confirm Metrics Server Installation
To verify whether the Metrics Server is installed, you can run:
- kind: ServiceAccount
- Install and Configure: Ensure that the Metrics Server is installed and configured correctly.
- Update Configuration: Edit the Metrics Server deployment if you notice any misconfigurations.
- Monitor Cluster Health: Regularly check the health status of your nodes and the entire cluster.
- Network and RBAC Policies: Review and update network and RBAC policies to ensure seamless operations.

