From c72e00435a4169d591b1ba8ddd53228b26557cbd Mon Sep 17 00:00:00 2001 From: Kohei Matsumoto <1430085+k-mats@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:58:46 +0900 Subject: [PATCH] Migrate autoscaling/v2beta1 to autoscaling/v2 (#97) --- charts/dify/Chart.yaml | 2 +- charts/dify/templates/hpa.yaml | 40 ++++++++++++++++++++++++---------- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/charts/dify/Chart.yaml b/charts/dify/Chart.yaml index 50431ed..182a0a3 100644 --- a/charts/dify/Chart.yaml +++ b/charts/dify/Chart.yaml @@ -20,7 +20,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.4.1 +version: 0.5.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/dify/templates/hpa.yaml b/charts/dify/templates/hpa.yaml index f4aa886..04196db 100644 --- a/charts/dify/templates/hpa.yaml +++ b/charts/dify/templates/hpa.yaml @@ -1,6 +1,6 @@ {{- if .Values.api.autoscaling.enabled }} --- -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "dify.fullname" . }}-api @@ -18,20 +18,24 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.api.autoscaling.targetCPUUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.api.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- if .Values.api.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.api.autoscaling.targetMemoryUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.api.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }} {{- if .Values.frontend.autoscaling.enabled }} --- -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "dify.fullname" . }}-frontend @@ -49,19 +53,23 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.frontend.autoscaling.targetCPUUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.frontend.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- if .Values.frontend.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.frontend.autoscaling.targetMemoryUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.frontend.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }} {{- if .Values.worker.autoscaling.enabled }} --- -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "dify.fullname" . }}-worker @@ -79,18 +87,22 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.worker.autoscaling.targetCPUUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.worker.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- if .Values.worker.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.worker.autoscaling.targetMemoryUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.worker.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }} {{- if .Values.sandbox.autoscaling.enabled }} --- -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "dify.fullname" . }}-sandbox @@ -108,12 +120,16 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.sandbox.autoscaling.targetCPUUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.sandbox.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- if .Values.sandbox.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.sandbox.autoscaling.targetMemoryUtilizationPercentage }} + target: + type: Utilization + averageUtilization: {{ .Values.sandbox.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }}