From b96fbe561e93eb7b9f924496dc0596002efe22cc Mon Sep 17 00:00:00 2001 From: Calle Englund Date: Sat, 12 Oct 2024 00:52:43 +0200 Subject: [PATCH] feat(forgejo-runner): add hpa behavior support Allows customizing HPA behaviors when autoscaling is enabled. --- forgejo-runner/templates/hpa.yaml | 4 ++++ forgejo-runner/values.yaml | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/forgejo-runner/templates/hpa.yaml b/forgejo-runner/templates/hpa.yaml index c221811..6779bfb 100644 --- a/forgejo-runner/templates/hpa.yaml +++ b/forgejo-runner/templates/hpa.yaml @@ -12,6 +12,10 @@ spec: name: {{ include "forgejo-runner.fullname" . }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} + {{- with .Values.autoscaling.behavior }} + behavior: + {{- toYaml . | nindent 4 }} + {{- end }} metrics: {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - type: Resource diff --git a/forgejo-runner/values.yaml b/forgejo-runner/values.yaml index 2abfc83..e796b3b 100644 --- a/forgejo-runner/values.yaml +++ b/forgejo-runner/values.yaml @@ -191,6 +191,19 @@ autoscaling: enabled: false minReplicas: 1 maxReplicas: 100 + behavior: {} + # scaleDown: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 1 + # periodSeconds: 60 + # scaleUp: + # stabilizationWindowSeconds: 0 + # policies: + # - type: Pods + # value: 1 + # periodSeconds: 60 targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80