Forum Navigation
You need to log in to create posts and topics.

error: Metrics API not available

Problem

user running the following command gets an error

kubectl top nodes

error: Metrics API not available

Solution

add metrics server deployment for resource utilization details

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

For HA deployments

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

Patch Master node to run metrics server

kubectl patch deployments -n kube-system metrics-server -p ‘{“spec”: {“template”: {“spec”: {“nodeSelector”: {“kubernetes.io/hostname”: “MASTER-NODE-NAME”}}}}}’

 

Uploaded files:
If you have found my website, guides, articles or videos useful, please buy me a coffee