From 7d27f39953fb131b75088a9f34c4c069492ae2e0 Mon Sep 17 00:00:00 2001 From: Long Wu Yuan Date: Mon, 5 Jun 2023 20:37:27 +0530 Subject: [PATCH] ensured hpa mem spec before cpu spec (#10043) --- .../ingress-nginx/templates/controller-hpa.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/charts/ingress-nginx/templates/controller-hpa.yaml b/charts/ingress-nginx/templates/controller-hpa.yaml index 96a91f533..f212bc4f5 100644 --- a/charts/ingress-nginx/templates/controller-hpa.yaml +++ b/charts/ingress-nginx/templates/controller-hpa.yaml @@ -21,14 +21,6 @@ spec: minReplicas: {{ .Values.controller.autoscaling.minReplicas }} maxReplicas: {{ .Values.controller.autoscaling.maxReplicas }} metrics: - {{- with .Values.controller.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ . }} - {{- end }} {{- with .Values.controller.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: @@ -37,6 +29,14 @@ spec: type: Utilization averageUtilization: {{ . }} {{- end }} + {{- with .Values.controller.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ . }} + {{- end }} {{- with .Values.controller.autoscalingTemplate }} {{- toYaml . | nindent 2 }} {{- end }}