From f53c416a589068b111f2b0130bdf0a24aaaa48dc Mon Sep 17 00:00:00 2001 From: Jeff Robertson Date: Tue, 16 Sep 2025 21:26:02 -0400 Subject: [PATCH] support hpa behavior for haproxy chart --- haproxy/ci/deployment-hpa-values.yaml | 12 ++++++++++++ haproxy/templates/hpa.yaml | 3 +++ haproxy/values.yaml | 5 +++++ 3 files changed, 20 insertions(+) diff --git a/haproxy/ci/deployment-hpa-values.yaml b/haproxy/ci/deployment-hpa-values.yaml index bb05e8d..0b03ff7 100644 --- a/haproxy/ci/deployment-hpa-values.yaml +++ b/haproxy/ci/deployment-hpa-values.yaml @@ -5,3 +5,15 @@ autoscaling: minReplicas: 1 maxReplicas: 5 targetCPUUtilizationPercentage: 80 + behavior: + scaleUp: + policies: + - type: Percent + value: 900 + periodSeconds: 60 + scaleDown: + stabilizationWindowSeconds: 600 + policies: + - type: Pods + value: 1 + periodSeconds: 600 diff --git a/haproxy/templates/hpa.yaml b/haproxy/templates/hpa.yaml index 7451146..74afeb8 100644 --- a/haproxy/templates/hpa.yaml +++ b/haproxy/templates/hpa.yaml @@ -36,6 +36,9 @@ spec: name: {{ include "haproxy.fullname" . }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} + {{- if .Values.autoscaling.behavior }} + behavior: {{- toYaml .Values.autoscaling.behavior | nindent 4 }} + {{- end }} metrics: {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource diff --git a/haproxy/values.yaml b/haproxy/values.yaml index ef5c9f8..3f6ad26 100644 --- a/haproxy/values.yaml +++ b/haproxy/values.yaml @@ -440,6 +440,11 @@ autoscaling: # target: # type: Value # value: 10k + ## Behavior + ## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#configurable-scaling-behavior + # behavior: + # scaleDown: + # stabilizationWindowSeconds: 3600 keda: enabled: false