From 8ada0028afa879284ba6f896b98c58c5db603cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20G=C3=B3mez?= Date: Fri, 29 Nov 2024 09:37:16 -0500 Subject: [PATCH] HPA are v2 since Kubernetes v1.23 --- charts/wiremock/templates/hpa.yaml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/charts/wiremock/templates/hpa.yaml b/charts/wiremock/templates/hpa.yaml index 48ebec6..3b38c10 100644 --- a/charts/wiremock/templates/hpa.yaml +++ b/charts/wiremock/templates/hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "wiremock.fullname" . }} @@ -14,15 +14,19 @@ spec: maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: + - resource: name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + type: Resource {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: + - resource: name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + type: Resource {{- end }} {{- end }}