Vikas Rathore
Vikas Rathore

Reputation: 8821

Kubernetes HPA: failed to get memory utilization: unable to get metrics for resource memory: no metrics returned from resource metrics API

I deployed the metric server into my EKS

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

but started getting this error when I ran kubectl describe hpa hpa-frontend

Warning  FailedGetResourceMetric       2m5s (x3 over 2m35s)  horizontal-pod-autoscaler  unable to get metrics for resource memory: no metrics returned from resource metrics API
  Warning  FailedGetResourceMetric       2m5s (x3 over 2m35s)  horizontal-pod-autoscaler  unable to get metrics for resource cpu: no metrics returned from resource metrics API
  Warning  FailedComputeMetricsReplicas  2m5s (x3 over 2m35s)  horizontal-pod-autoscaler  invalid metrics (2 invalid out of 2), first error is: failed to get memory utilization: unable to get metrics for resource memory: no metrics returned from resource metrics API
  Warning  FailedGetResourceMetric       65s (x4 over 110s)    horizontal-pod-autoscaler  did not receive metrics for any ready pods

I am already using this setting:

containers:
      - name: metrics-server
        image: k8s.gcr.io/metrics-server/metrics-server:v0.3.7
        imagePullPolicy: IfNotPresent
        command:
          - /metrics-server
          - --kubelet-insecure-tls=true
          - --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
          - --v=2
        args:
          - --cert-dir=/tmp
          - --secure-port=4443

Upvotes: 1

Views: 3308

Answers (0)

Related Questions