From de1f6e6fc5853a1d9801da789138ae8b0cba46e0 Mon Sep 17 00:00:00 2001 From: MOHANKUMAR T <31698165+mohan-13@users.noreply.github.com> Date: Wed, 19 Jun 2024 20:36:32 +0530 Subject: [PATCH] BAH-3911 | Upgrade HPA to stable API (#85) --- 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 628e072..5df81b5 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 }}