diff --git a/charts/bluegreen/templates/hpa.yaml b/charts/bluegreen/templates/hpa.yaml index 49056de..bd905e1 100644 --- a/charts/bluegreen/templates/hpa.yaml +++ b/charts/bluegreen/templates/hpa.yaml @@ -1,15 +1,15 @@ {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: {{ include "bulegreen.fullname" . }} + name: {{ include "website.fullname" . }} labels: - {{- include "bulegreen.labels" . | nindent 4 }} + {{- include "website.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "bulegreen.fullname" . }} + name: {{ include "website.fullname" . }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: @@ -17,12 +17,16 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + target: + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + type: Utilization {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + target: + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + type: Utilization {{- end }} {{- end }}