diff --git a/package/helm/templates/hpa.yaml b/package/helm/templates/hpa.yaml index c45f359320..5df81b52df 100644 --- a/package/helm/templates/hpa.yaml +++ b/package/helm/templates/hpa.yaml @@ -1,12 +1,11 @@ {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ .Chart.Name }} labels: app: {{ .Chart.Name }} environment: {{ .Values.metadata.labels.environment }} - spec: scaleTargetRef: apiVersion: apps/v1 @@ -19,12 +18,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 }}