From 7144d269544fe4a5d1de368de2f0a16df803a17a Mon Sep 17 00:00:00 2001 From: David Burke Date: Fri, 23 Dec 2022 10:21:07 -0500 Subject: [PATCH] Update hpa version --- templates/web/hpa.yaml | 14 +++++++++----- templates/worker/hpa.yaml | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/templates/web/hpa.yaml b/templates/web/hpa.yaml index a3cfffe..d518ec5 100644 --- a/templates/web/hpa.yaml +++ b/templates/web/hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.web.autoscaling.enabled -}} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ template "django.fullname" . }}-web @@ -13,16 +13,20 @@ spec: minReplicas: {{ .Values.web.autoscaling.minReplicas }} maxReplicas: {{ .Values.web.autoscaling.maxReplicas }} metrics: - {{- if .Values.web.autoscaling.targetCPUUtilizationPercentage }} + {{- if .Values.web.autoscaling.targetCPU }} - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.web.autoscaling.targetCPUUtilizationPercentage }} + target: + type: "Utilization" + averageUtilization: {{ .Values.web.autoscaling.targetCPU }} {{- end }} - {{- if .Values.web.autoscaling.targetMemoryUtilizationPercentage }} + {{- if .Values.web.autoscaling.targetMemory }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.web.autoscaling.targetMemoryUtilizationPercentage }} + target: + type: "Utilization" + averageUtilization: {{ .Values.web.autoscaling.targetMemory }} {{- end }} {{- end }} diff --git a/templates/worker/hpa.yaml b/templates/worker/hpa.yaml index 878c6f6..8521889 100644 --- a/templates/worker/hpa.yaml +++ b/templates/worker/hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.worker.autoscaling.enabled -}} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ template "django.fullname" . }}-worker @@ -13,16 +13,20 @@ spec: minReplicas: {{ .Values.worker.autoscaling.minReplicas }} maxReplicas: {{ .Values.worker.autoscaling.maxReplicas }} metrics: - {{- if .Values.worker.autoscaling.targetCPUUtilizationPercentage }} + {{- if .Values.worker.autoscaling.targetCPU }} - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.worker.autoscaling.targetCPUUtilizationPercentage }} + target: + type: "Utilization" + averageUtilization: {{ .Values.worker.autoscaling.targetCPU }} {{- end }} - {{- if .Values.worker.autoscaling.targetMemoryUtilizationPercentage }} + {{- if .Values.worker.autoscaling.targetMemory }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.worker.autoscaling.targetMemoryUtilizationPercentage }} + target: + type: "Utilization" + averageUtilization: {{ .Values.worker.autoscaling.targetMemory }} {{- end }} {{- end }} \ No newline at end of file