I am also facing the same issue in AKS, Could you please some one suggest us on this issue.
HPA is not working properly in AKS
Hi team,
I have deployed an HPA and defined the metrics for the CPU and memory, in case of high load the pod as well as the cluster is scaling but when the load reduces they are not scaling down. Please find the below details
error on the HPA
Warning FailedGetResourceMetric 8m2s (x22 over 111m) horizontal-pod-autoscaler failed to get cpu utilization: did not receive metrics for any ready pods
Warning FailedComputeMetricsReplicas 8m2s (x8 over 54m) horizontal-pod-autoscaler invalid metrics (1 invalid out of 2), first error is: failed to get cpu utilization: did not receive metrics for any ready pods
HPA deployment file
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
name: dev-hpa
namespace: dev-iapi
spec:
maxReplicas: 5 # define max replica count
minReplicas: 2 # define min replica count
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: dev-deployment
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 65
7 answers
Sort by: Newest
-
Singh thakur, Devendra [DPYUS NON-J&J] 0 Reputation points
2023-09-11T10:16:30.9866667+00:00 -
GERVAIS Hugo 1 Reputation point
2022-09-13T12:38:14.533+00:00 HI ,
i found the probleme. The label i used for the lbtype
apiVersion: apps/v1
kind: Deployment
metadata:
name: ur-front
namespace: recette-ur
labels:
app: front
spec:
replicas: 1
selector:
matchLabels:
lbtype: external
app: front
template:
metadata:
labels:
lbtype: external
app: frontthe label in bold was missing
-
GERVAIS Hugo 1 Reputation point
2022-09-05T16:10:54.293+00:00 Hi , im using aks version 1.24.3
-
GERVAIS Hugo 1 Reputation point
2022-09-02T14:33:32.027+00:00 i am also seeing similar behavior of error messages. It starting to become a big problem for your organisation , I had to static number of pods because of this (autoscaling not possible anymore)
-
Lopes Gomes, Eduardo 21 Reputation points
2022-08-19T11:57:08.317+00:00 I'm having this same problem, I'll follow this post to see if anyone found the solution.