Skip to content

Commit

Permalink
Update hpa.yaml
Browse files Browse the repository at this point in the history
Use `targetAverageUtilization` if cluster is running `autoscaling/v2beta1`, otherwise use new format.

Signed-off-by: Abhishek Mishra <[email protected]>
  • Loading branch information
amibhi authored Nov 20, 2024
1 parent 9bddd8a commit 326adfd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions charts/aws-pca-issuer/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 326adfd

Please sign in to comment.