Skip to content

Commit 326adfd

Browse files
authored
Update hpa.yaml
Use `targetAverageUtilization` if cluster is running `autoscaling/v2beta1`, otherwise use new format. Signed-off-by: Abhishek Mishra <[email protected]>
1 parent 9bddd8a commit 326adfd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

charts/aws-pca-issuer/templates/hpa.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,24 @@ spec:
2121
- type: Resource
2222
resource:
2323
name: cpu
24+
{{- if .Capabilities.APIVersions.Has "autoscaling/v2" }}
2425
target:
2526
type: Utilization
2627
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
28+
{{- else }}
29+
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
30+
{{- end }}
2731
{{- end }}
2832
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
2933
- type: Resource
3034
resource:
3135
name: memory
36+
{{- if .Capabilities.APIVersions.Has "autoscaling/v2" }}
3237
target:
3338
type: Utilization
3439
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
40+
{{- else }}
41+
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
42+
{{- end }}
3543
{{- end }}
3644
{{- end }}

0 commit comments

Comments
 (0)