From b43b6e7272e1fa8b010fe2231bc696df97e7d475 Mon Sep 17 00:00:00 2001 From: Ravi Singal Date: Tue, 14 May 2024 12:44:12 +0530 Subject: [PATCH] chore: configure hpa behavior --- helm/templates/hpa.yaml | 17 +++++++++++++++++ helm/values.yaml | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/helm/templates/hpa.yaml b/helm/templates/hpa.yaml index 21389e69..5ed8b793 100644 --- a/helm/templates/hpa.yaml +++ b/helm/templates/hpa.yaml @@ -9,6 +9,23 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: + {{- if .Values.hpa.behavior.enabled }} + behavior: + scaleUp: + policies: + - type: {{ .Values.hpa.behavior.scaleUp.policy.type }} + value: {{ .Values.hpa.behavior.scaleUp.policy.value }} + periodSeconds: {{ .Values.hpa.behavior.scaleUp.policy.periodSeconds }} + selectPolicy: {{ .Values.hpa.behavior.scaleUp.selectPolicy }} + stabilizationWindowSeconds: {{ .Values.hpa.behavior.scaleUp.stabilizationWindowSeconds }} + scaleDown: + policies: + - type: {{ .Values.hpa.behavior.scaleDown.policy.type }} + value: {{ .Values.hpa.behavior.scaleDown.policy.value }} + periodSeconds: {{ .Values.hpa.behavior.scaleDown.policy.periodSeconds }} + selectPolicy: {{ .Values.hpa.behavior.scaleDown.selectPolicy }} + stabilizationWindowSeconds: {{ .Values.hpa.behavior.scaleDown.selectPolicy }} + {{- end }} minReplicas: {{ int .Values.hpa.minReplicas }} maxReplicas: {{ int .Values.hpa.maxReplicas }} scaleTargetRef: diff --git a/helm/values.yaml b/helm/values.yaml index c5595cca..5cfb755c 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -97,3 +97,19 @@ hpa: minReplicas: 1 maxReplicas: 5 targetCPUUtilizationPercentage: 80 + behavior: + enabled: true + scaleUp: + policy: + type: Pods + value: 2 + periodSeconds: 60 + selectPolicy: Max + stabilizationWindowSeconds: 0 + scaleDown: + policy: + type: Pods + value: 1 + periodSeconds: 600 + selectPolicy: Min + stabilizationWindowSeconds: 600