Skip to content

Commit

Permalink
fix: support autoscaling/v2 formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
xip-niekneuij authored Nov 5, 2024
1 parent 9c8e000 commit 966ecc1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions charts/mercure/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +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 966ecc1

Please sign in to comment.