kubernetes-sigs / metrics-server

Scalable and efficient source of container resource metrics for Kubernetes built-in autoscaling pipelines.
https://kubernetes.io/docs/tasks/debug-application-cluster/resource-metrics-pipeline/
Apache License 2.0
5.85k stars 1.88k forks source link

Kubectl top pods command is giving error "error: Metrics not available for pod". even kubectl top nodes is working #1558

Open omduttpathak opened 2 months ago

omduttpathak commented 2 months ago

I am using kubernetes version Client Version: v1.22.0 Server Version: v1.24.1

I have installed metrics server by using below command and URL.

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

I can get the output successfully using "kubectl top nodes:" command. but Unable to get the metrics on "kubectl top pods" command. getting below error.

error: Metrics not available for pod kube-system/cadvisor-6rp4r, age: 2709h18m37.384021169s

I tried with other namespace also but same error "error: Metrics not available for pod xxx"

dashpole commented 2 months ago

/assign @yangjunmyfm192085 /triage accepted

yangjunmyfm192085 commented 2 months ago

Hi, @omduttpathak You can refer to the following known issues to see if they can help you. https://github.com/kubernetes-sigs/metrics-server/blob/master/KNOWN_ISSUES.md#kubelet-doesnt-report-pod-metrics