AKS 1.29, HPA unable to get metrics

Cloudy 206 Reputation points
2024-08-05T15:47:54.0833333+00:00

Hi Folks !

I'm facing the following warnings on many hpa, "unable to get metrics"... cannot understand why, visibly i'm not the only one.

Do anybody have any clue on what to do in order to avoid that ?

Man thanks !

kubectl describe hpa apache-appl -n legacy
Name:                                                     apache-app
Namespace:                                                legacy
Labels:                                                   app.kubernetes.io/instance=legacy
                                                          app.kubernetes.io/managed-by=Helm
                                                          app.kubernetes.io/name=appl
                                                          app.kubernetes.io/part-of=app
                                                          app.kubernetes.io/version=0.1.0
                                                          helm.sh/chart=legacy-0.1.0
Annotations:                                              meta.helm.sh/release-name: legacy
                                                          meta.helm.sh/release-namespace: legacy
CreationTimestamp:                                        Wed, 10 Jul 2024 10:24:18 +0000
Reference:                                                Deployment/apache-app
Metrics:                                                  ( current / target )
  resource cpu on pods  (as a percentage of request):     2% (20m) / 95%
  resource memory on pods  (as a percentage of request):  57% (147651242666m) / 95%
Min replicas:                                             3
Max replicas:                                             10
Deployment pods:                                          3 current / 3 desired
Conditions:
  Type            Status  Reason            Message
  ----            ------  ------            -------
  AbleToScale     True    ReadyForNewScale  recommended size matches current size
  ScalingActive   True    ValidMetricFound  the HPA was able to successfully calculate a replica count from memory resource utilization (percentage of request)
  ScalingLimited  True    TooFewReplicas    the desired replica count is less than the minimum replica count
Events:
  Type     Reason                        Age                 From                       Message
  ----     ------                        ----                ----                       -------
  Warning  FailedComputeMetricsReplicas  27m (x7 over 12h)   horizontal-pod-autoscaler  invalid metrics (1 invalid out of 2), first error is: failed to get cpu resource metric value: failed to get cpu utilization: unable to get metrics for resource cpu: no metrics returned from resource metrics API
  Warning  FailedGetResourceMetric       15m (x25 over 12h)  horizontal-pod-autoscaler  failed to get cpu utilization: unable to get metrics for resource cpu: no metrics returned from resource metrics API
  Warning  FailedGetResourceMetric       15m (x23 over 12h)  horizontal-pod-autoscaler  failed to get memory utilization: unable to get metrics for resource memory: no metrics returned from resource metrics API
  Warning  FailedComputeMetricsReplicas  15m (x18 over 12h)  horizontal-pod-autoscaler  invalid metrics (2 invalid out of 2), first error is: failed to get cpu resource metric value: failed to get cpu utilization: unable to get metrics for resource cpu: no metrics returned from resource metrics API
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,073 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.