kuberneteshpametrics-server

Kubernetes Metrics Server no metrics known for some Pods


I have the following deployments one of Django api and the other of celery, when I run the command to get the resource consumption of the pods, it only return those of celery and not those of the API. What are potential reasons for this? given that the same configuration works well on another cluster

Kubernetes Server Version: v1.22.5

enter image description here

EDIT: Added logs of metrics server

I0824 13:28:05.498602       1 serving.go:342] Generated self-signed cert (apiserver.local.config/certificates/apiserver.crt, apiserver.local.config/certificates/apiserver.key)
I0824 13:28:06.269888       1 requestheader_controller.go:169] Starting RequestHeaderAuthRequestController
I0824 13:28:06.269917       1 shared_informer.go:240] Waiting for caches to sync for RequestHeaderAuthRequestController
I0824 13:28:06.269966       1 configmap_cafile_content.go:201] "Starting controller" name="client-ca::kube-system::extension-apiserver-authentication::client-ca-file"
I0824 13:28:06.269981       1 shared_informer.go:240] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::client-ca-file
I0824 13:28:06.270005       1 configmap_cafile_content.go:201] "Starting controller" name="client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file"
I0824 13:28:06.270025       1 shared_informer.go:240] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file
I0824 13:28:06.270512       1 secure_serving.go:266] Serving securely on [::]:8443
I0824 13:28:06.270577       1 dynamic_serving_content.go:131] "Starting controller" name="serving-cert::apiserver.local.config/certificates/apiserver.crt::apiserver.local.config/certificates/apiserver.key"
I0824 13:28:06.270593       1 tlsconfig.go:240] "Starting DynamicServingCertificateController"
W0824 13:28:06.270852       1 shared_informer.go:372] The sharedIndexInformer has started, run more than once is not allowed
I0824 13:28:06.277601       1 server.go:187] "Failed probe" probe="metric-storage-ready" err="no metrics to serve"
I0824 13:28:06.371038       1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file 
I0824 13:28:06.371093       1 shared_informer.go:247] Caches are synced for RequestHeaderAuthRequestController 
I0824 13:28:06.371932       1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::client-ca-file

Solution

  • I upgraded my cluster to 1.23.4 and my HPAs to autoscaling/v2 api and now everything works fine, I suppose my problem was related to this issue because my api pod had an initContainer.