mirror of
https://gitea.com/gitea/helm-actions.git
synced 2026-08-03 22:43:01 +00:00
This a correction that is forf from original work of [anders.eficode](https://gitea.com/anders.eficode) on [pull request #160](https://gitea.com/gitea/helm-actions/pulls/160) Description of the change Adds statefulset.dind.resources and statefulset.runner.resources as optional per-container resource overrides. When set, each takes precedence over the shared statefulset.resources for that container. When unset (default {}), statefulset.resources is used as before. Benefits The DinD sidecar and the runner container have very different resource profiles — DinD is memory-hungry (image layer cache, concurrent builds, image pulls) while the runner is a lightweight coordinator that is mostly idle between jobs. Separate resource limits allow right-sizing each container independently, avoiding the choice between over-provisioning the runner or under-provisioning DinD. Possible drawbacks None. Fully backward-compatible — both new values default to {}, causing the shared statefulset.resources fallback to apply exactly as before. Checklist - [x] Parameters are documented in the `values.yaml` and added to the `README.md` using [readme-generator-for-helm](https://github.com/bitnami-labs/readme-generator-for-helm) - [x] Breaking changes are documented in the `README.md` - [x] Helm templating unittests are added (required when changing anything in `templates` folder) - [x] Bash unittests are added (required when changing anything in `scripts` folder) - [x] All added template resources MUST render a namespace in metadata --------- Co-authored-by: Le Prévost-Corvellec Arnault <arnault.le.prevost.corvellec@carbon-it.com> Co-authored-by: Anders <lantzanders@gmail.com> Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/168 Reviewed-by: DaanSelen <135789+daanselen@noreply.gitea.com> Co-authored-by: Arnault_LPC <194310+arnault_lpc@noreply.gitea.com>
This commit is contained in:
@@ -116,6 +116,13 @@ Create image for the Gitea Actions Act Runner
|
||||
{{ include "gitea.actions.common.image" (dict "root" . "image" .Values.statefulset.runner) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Resolve resource requests/limits for the runner container.
|
||||
*/}}
|
||||
{{- define "gitea.actions.runner.resources" -}}
|
||||
{{- toYaml (default .Values.statefulset.resources .Values.statefulset.runner.resources) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create image for DinD
|
||||
*/}}
|
||||
@@ -123,6 +130,13 @@ Create image for DinD
|
||||
{{ include "gitea.actions.common.image" (dict "root" . "image" .Values.statefulset.dind) }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Resolve resource requests/limits for the DinD container.
|
||||
*/}}
|
||||
{{- define "gitea.actions.dind.resources" -}}
|
||||
{{- toYaml (default .Values.statefulset.resources .Values.statefulset.dind.resources) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create image for Init
|
||||
*/}}
|
||||
|
||||
@@ -120,7 +120,7 @@ spec:
|
||||
- /var/run/docker.sock
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.statefulset.resources | nindent 12 }}
|
||||
{{- include "gitea.actions.dind.resources" . | nindent 12 }}
|
||||
volumeMounts:
|
||||
{{- if .Values.statefulset.dind.rootless }}
|
||||
- mountPath: /run/user/{{ .Values.statefulset.dind.uid | default 1000 }}/
|
||||
@@ -155,7 +155,7 @@ spec:
|
||||
{{- toYaml .Values.statefulset.runner.extraEnvs | nindent 12 }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.statefulset.resources | nindent 12 }}
|
||||
{{- include "gitea.actions.runner.resources" . | nindent 12 }}
|
||||
volumeMounts:
|
||||
- mountPath: /runner/config.yaml
|
||||
name: runner-config
|
||||
|
||||
Reference in New Issue
Block a user