Merge branch 'fix-autoscaling-v2-support' into 'master'

updated to autoscaling/v2

See merge request ananace/charts!55
This commit is contained in:
Alexander Olofsson 2023-09-08 08:43:27 +00:00
commit 38240f3edc
No known key found for this signature in database

View file

@ -1,9 +1,5 @@
{{- if .Values.autoscaling.enabled }}
{{- if .Capabilities.APIVersions.Has "autoscaling/v2" -}}
apiVersion: autoscaling/v2
{{- else -}}
apiVersion: autoscaling/v2beta1
{{- end }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "matrix-media-repo.fullname" . }}
@ -21,12 +17,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 }}