feat(forgejo-runner): add hpa behavior support

Allows customizing HPA behaviors when autoscaling is enabled.
This commit is contained in:
Calle Englund 2024-10-12 00:52:43 +02:00 committed by WrenIX
parent 48c65fe19f
commit 34635afd4b
Signed by: wrenix
GPG key ID: 7AFDB012974B1BB5
4 changed files with 26 additions and 2 deletions

View file

@ -2,7 +2,7 @@ apiVersion: v2
name: forgejo-runner name: forgejo-runner
description: Deploy runner for an forgejo instance (default codeberg.org) description: Deploy runner for an forgejo instance (default codeberg.org)
type: application type: application
version: 0.2.14 version: 0.3.0
# renovate: image=code.forgejo.org/forgejo/runner # renovate: image=code.forgejo.org/forgejo/runner
appVersion: "3.5.1" appVersion: "3.5.1"
maintainers: maintainers:

View file

@ -2,7 +2,7 @@
= forgejo-runner = 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/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] image::https://img.shields.io/badge/AppVersion-3.5.1-informational?style=flat-square[AppVersion: 3.5.1]
== Maintainers == 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 | autoscaling.enabled
| bool | bool
| `false` | `false`

View file

@ -12,6 +12,10 @@ spec:
name: {{ include "forgejo-runner.fullname" . }} name: {{ include "forgejo-runner.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }} minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }}
{{- with .Values.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
metrics: metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }} {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource - type: Resource

View file

@ -191,6 +191,21 @@ autoscaling:
enabled: false enabled: false
minReplicas: 1 minReplicas: 1
maxReplicas: 100 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 targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80