From bcd9ffe27765c1842b6934f329ffaebdfa4fa168 Mon Sep 17 00:00:00 2001 From: MOHANKUMAR T <31698165+mohan-13@users.noreply.github.com> Date: Tue, 18 Jun 2024 15:34:49 +0530 Subject: [PATCH] BAH-3911 | Upgrade HPA to stable API --- package/helm/templates/hpa.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/package/helm/templates/hpa.yaml b/package/helm/templates/hpa.yaml index 628e0725..5df81b52 100644 --- a/package/helm/templates/hpa.yaml +++ b/package/helm/templates/hpa.yaml @@ -1,12 +1,11 @@ {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ .Chart.Name }} labels: app: {{ .Chart.Name }} environment: {{ .Values.metadata.labels.environment }} - spec: scaleTargetRef: apiVersion: apps/v1 @@ -19,12 +18,16 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} - {{- end }} \ No newline at end of file +{{- end }}