From 24004ed6add7e26a8f4fc080f2476dad950685e4 Mon Sep 17 00:00:00 2001 From: Peixian Wang Date: Thu, 27 Mar 2025 19:34:14 -0400 Subject: [PATCH] Fix HPA Template --- charts/whatsapp-proxy-chart/Chart.yaml | 2 +- charts/whatsapp-proxy-chart/templates/deployment.yaml | 10 ++++++++++ charts/whatsapp-proxy-chart/templates/hpa.yaml | 10 +++++++--- charts/whatsapp-proxy-chart/templates/service.yaml | 1 - 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/charts/whatsapp-proxy-chart/Chart.yaml b/charts/whatsapp-proxy-chart/Chart.yaml index 2e1340c5..3dff6131 100644 --- a/charts/whatsapp-proxy-chart/Chart.yaml +++ b/charts/whatsapp-proxy-chart/Chart.yaml @@ -17,7 +17,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: 1.1.0 +version: 1.2.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/whatsapp-proxy-chart/templates/deployment.yaml b/charts/whatsapp-proxy-chart/templates/deployment.yaml index d0206772..a5222d1f 100644 --- a/charts/whatsapp-proxy-chart/templates/deployment.yaml +++ b/charts/whatsapp-proxy-chart/templates/deployment.yaml @@ -68,6 +68,16 @@ spec: containerPort: 5222 protocol: TCP {{- end}} + {{- if .Values.service.media_port }} + - name: media + containerPort: 587 + protocol: TCP + {{- end}} + {{- if .Values.service.media_proxy_port}} + - name: media-proxy + containerPort: 7777 + protocol: TCP + {{- end}} {{- if .Values.service.stats_port }} - name: stats containerPort: 8199 diff --git a/charts/whatsapp-proxy-chart/templates/hpa.yaml b/charts/whatsapp-proxy-chart/templates/hpa.yaml index e127efa1..49a41813 100644 --- a/charts/whatsapp-proxy-chart/templates/hpa.yaml +++ b/charts/whatsapp-proxy-chart/templates/hpa.yaml @@ -3,7 +3,7 @@ # License found in the LICENSE file in the root directory # of this source tree. {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "whatsapp-proxy-chart.fullname" . }} @@ -21,12 +21,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 }} diff --git a/charts/whatsapp-proxy-chart/templates/service.yaml b/charts/whatsapp-proxy-chart/templates/service.yaml index c4b154d9..6e4d69fe 100644 --- a/charts/whatsapp-proxy-chart/templates/service.yaml +++ b/charts/whatsapp-proxy-chart/templates/service.yaml @@ -64,7 +64,6 @@ spec: protocol: TCP name: media {{- end}} - {{- if .Values.service.media_proxy_port }} - port: {{ .Values.service.media_proxy_port }} targetPort: 7777