From 34635afd4b5aaeedce42b784a9b6e46f44439d7e 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/Chart.yaml | 2 +- forgejo-runner/README.adoc | 7 ++++++- forgejo-runner/templates/hpa.yaml | 4 ++++ forgejo-runner/values.yaml | 15 +++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/forgejo-runner/Chart.yaml b/forgejo-runner/Chart.yaml index 4b33137..17dc7be 100644 --- a/forgejo-runner/Chart.yaml +++ b/forgejo-runner/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: forgejo-runner description: Deploy runner for an forgejo instance (default codeberg.org) type: application -version: 0.2.14 +version: 0.3.0 # renovate: image=code.forgejo.org/forgejo/runner appVersion: "3.5.1" maintainers: diff --git a/forgejo-runner/README.adoc b/forgejo-runner/README.adoc index cda3c52..9d1ef98 100644 --- a/forgejo-runner/README.adoc +++ b/forgejo-runner/README.adoc @@ -2,7 +2,7 @@ = forgejo-runner -image::https://img.shields.io/badge/Version-0.2.14-informational?style=flat-square[Version: 0.2.14] +image::https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square[Version: 0.3.0] image::https://img.shields.io/badge/Version-application-informational?style=flat-square[Type: application] image::https://img.shields.io/badge/AppVersion-3.5.1-informational?style=flat-square[AppVersion: 3.5.1] == Maintainers @@ -208,6 +208,11 @@ helm uninstall forgejo-runner-release | `{}` | +| autoscaling.behavior +| object +| `{}` +| behavior of HPA Example: scaleDown: stabilizationWindowSeconds: 300 policies: - type: Pods value: 1 periodSeconds: 60 scaleUp: stabilizationWindowSeconds: 0 policies: - type: Pods value: 1 periodSeconds: 60 + | autoscaling.enabled | bool | `false` 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..b541353 100644 --- a/forgejo-runner/values.yaml +++ b/forgejo-runner/values.yaml @@ -191,6 +191,21 @@ autoscaling: enabled: false minReplicas: 1 maxReplicas: 100 + # -- behavior of HPA + # Example: + # scaleDown: + # stabilizationWindowSeconds: 300 + # policies: + # - type: Pods + # value: 1 + # periodSeconds: 60 + # scaleUp: + # stabilizationWindowSeconds: 0 + # policies: + # - type: Pods + # value: 1 + # periodSeconds: 60 + behavior: {} targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80