From 326adfdd5b07df68d61043c6d21d8699ebd352f1 Mon Sep 17 00:00:00 2001 From: Abhishek Mishra Date: Wed, 20 Nov 2024 18:12:40 -0500 Subject: [PATCH] Update hpa.yaml Use `targetAverageUtilization` if cluster is running `autoscaling/v2beta1`, otherwise use new format. Signed-off-by: Abhishek Mishra --- charts/aws-pca-issuer/templates/hpa.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/charts/aws-pca-issuer/templates/hpa.yaml b/charts/aws-pca-issuer/templates/hpa.yaml index ea625627..9dc33fdd 100644 --- a/charts/aws-pca-issuer/templates/hpa.yaml +++ b/charts/aws-pca-issuer/templates/hpa.yaml @@ -21,16 +21,24 @@ spec: - type: Resource resource: name: cpu + {{- if .Capabilities.APIVersions.Has "autoscaling/v2" }} target: type: Utilization averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- else }} + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory + {{- if .Capabilities.APIVersions.Has "autoscaling/v2" }} target: type: Utilization averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- else }} + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} {{- end }} {{- end }}