From 92961b8b2e40512fdfc5ae9dcf2cd6bad3838e3a Mon Sep 17 00:00:00 2001 From: "Brian Suh (WhatsApp)" Date: Fri, 10 Jul 2026 12:13:26 -0700 Subject: [PATCH] Add customMetrics support to HPA autoscaling Summary: Adds a configurable `customMetrics` list to the WhatsApp proxy chart's autoscaling values, rendered into the HPA template's metrics section. This allows defining custom autoscaling metrics beyond CPU/memory. Test Plan: - helm template renders with default (empty) customMetrics - helm template renders custom metrics when provided Reviewers: Subscribers: Tasks: Tags: --- charts/whatsapp-proxy-chart/Chart.yaml | 2 +- charts/whatsapp-proxy-chart/templates/hpa.yaml | 3 +++ charts/whatsapp-proxy-chart/values.yaml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/whatsapp-proxy-chart/Chart.yaml b/charts/whatsapp-proxy-chart/Chart.yaml index 10b2fed..2b1ab0f 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.3.6 +version: 1.3.7 # 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/hpa.yaml b/charts/whatsapp-proxy-chart/templates/hpa.yaml index 49a4181..4f6f1fc 100644 --- a/charts/whatsapp-proxy-chart/templates/hpa.yaml +++ b/charts/whatsapp-proxy-chart/templates/hpa.yaml @@ -33,4 +33,7 @@ spec: type: Utilization averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} + {{- with .Values.autoscaling.customMetrics }} + {{- toYaml . | nindent 4 }} + {{- end }} {{- end }} diff --git a/charts/whatsapp-proxy-chart/values.yaml b/charts/whatsapp-proxy-chart/values.yaml index 229fc28..47d140c 100644 --- a/charts/whatsapp-proxy-chart/values.yaml +++ b/charts/whatsapp-proxy-chart/values.yaml @@ -96,6 +96,7 @@ autoscaling: maxReplicas: 100 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 + customMetrics: [] nodeSelector: {}