From 80592de2d022b47d9b3069e9df64ea69491050df Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Fri, 4 Sep 2026 12:00:11 +0200 Subject: [PATCH] feat(deployment)!: move `schedulerName` to `deployment.schedulerName` The top-level `schedulerName` value only ever configured the pod spec of the Gitea Deployment, but was declared next to chart-wide settings. Moving it into the `deployment` dict completes the consolidation already done for `affinity`, `dnsConfig`, `nodeSelector`, `priorityClassName`, `resources`, `tolerations` and `topologySpreadConstraints`, so every pod scheduling setting now lives in one predictable place. A deprecation check fails the release when the removed top-level value is still set. Silently ignoring it would be hard to debug: the pod would fall back to the `default-scheduler` without any warning, bypassing the custom scheduler the user relies on for placement decisions such as storage locality. BREAKING CHANGE: `schedulerName` no longer exists. Use `deployment.schedulerName` instead. Installations that still set `schedulerName` will fail unless `checkDeprecation` is set to `false`. Co-authored-by: Copilot --- README.md | 2 +- templates/gitea/deployment.yaml | 4 ++-- templates/gitea/deprecation.yaml | 5 +++++ unittests/helm/deployment/basic.yaml | 13 +++++++++++++ unittests/helm/deployment/deprecations.yaml | 7 +++++++ values.yaml | 9 +++------ 6 files changed, 31 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1302609..91f056f 100644 --- a/README.md +++ b/README.md @@ -1118,7 +1118,6 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo | `gatewayAPI.nginx.clientSettingsPolicies.labels` | Additional labels applied to the ClientSettingsPolicy | `{}` | | `gatewayAPI.nginx.clientSettingsPolicies.targetRef` | Target reference for the ClientSettingsPolicy. Defaults to the chart's HTTPRoute. | `{}` | | `gatewayAPI.nginx.clientSettingsPolicies.body` | Client body settings (required when enabled), e.g. `maxSize`. See `docs/gateway-api.md`. | `{}` | -| `schedulerName` | Use an alternate scheduler, e.g. "stork" | `""` | ### deployment @@ -1134,6 +1133,7 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo | `deployment.nodeSelector` | NodeSelector for the deployment | `{}` | | `deployment.priorityClassName` | priorityClassName for the deployment | `""` | | `deployment.resources` | Resources is the total amount of CPU and Memory resources required by all containers in the pod. | `{}` | +| `deployment.schedulerName` | Use an alternate scheduler, e.g. "stork" | `""` | | `deployment.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod | `60` | | `deployment.tolerations` | Tolerations of the Gitea deployment. | `[]` | | `deployment.topologySpreadConstraints` | TopologySpreadConstraints for the deployment | `[]` | diff --git a/templates/gitea/deployment.yaml b/templates/gitea/deployment.yaml index f03f71f..f9c6b62 100644 --- a/templates/gitea/deployment.yaml +++ b/templates/gitea/deployment.yaml @@ -66,8 +66,8 @@ spec: {{- $containerSecurityContext := include "gitea.containerSecurityContext" (list . (deepCopy .Values.containerSecurityContext)) | trim }} {{- $commandInitContainerSecurityContext := include "gitea.commandInitContainerSecurityContext" (list . (deepCopy .Values.containerSecurityContext)) | trim }} {{- $runtimeContainerSecurityContext := include "gitea.runtimeContainerSecurityContext" . | trim }} - {{- if .Values.schedulerName }} - schedulerName: "{{ .Values.schedulerName }}" + {{- if .Values.deployment.schedulerName }} + schedulerName: "{{ .Values.deployment.schedulerName }}" {{- end }} {{- if (or .Values.serviceAccount.create .Values.serviceAccount.name) }} serviceAccountName: {{ include "gitea.serviceAccountName" . }} diff --git a/templates/gitea/deprecation.yaml b/templates/gitea/deprecation.yaml index d92f1a3..b8f3053 100644 --- a/templates/gitea/deprecation.yaml +++ b/templates/gitea/deprecation.yaml @@ -70,6 +70,11 @@ {{- fail "`resources` does no longer exist. Please refer to the changelog and configure `deployment.gitea.resources` instead." -}} {{- end -}} + {{/* SCHEDULER NAME */}} + {{- if .Values.schedulerName -}} + {{- fail "`schedulerName` does no longer exist. Please refer to the changelog and configure `deployment.schedulerName` instead." -}} + {{- end -}} + {{/* TOLERATIONS */}} {{- if .Values.tolerations -}} {{- fail "`tolerations` does no longer exist. Please refer to the changelog and configure `deployment.tolerations` instead." -}} diff --git a/unittests/helm/deployment/basic.yaml b/unittests/helm/deployment/basic.yaml index a213c4c..34cb860 100644 --- a/unittests/helm/deployment/basic.yaml +++ b/unittests/helm/deployment/basic.yaml @@ -139,6 +139,19 @@ tests: - equal: path: spec.template.spec.priorityClassName value: high-priority + - it: schedulerName is undefined + template: templates/gitea/deployment.yaml + asserts: + - notExists: + path: spec.template.spec.schedulerName + - it: schedulerName is defined + template: templates/gitea/deployment.yaml + set: + deployment.schedulerName: stork + asserts: + - equal: + path: spec.template.spec.schedulerName + value: stork - it: tolerations are undefined template: templates/gitea/deployment.yaml asserts: diff --git a/unittests/helm/deployment/deprecations.yaml b/unittests/helm/deployment/deprecations.yaml index 146548a..d1ea8fc 100644 --- a/unittests/helm/deployment/deprecations.yaml +++ b/unittests/helm/deployment/deprecations.yaml @@ -60,6 +60,12 @@ tests: asserts: - failedTemplate: errorMessage: "`resources` does no longer exist. Please refer to the changelog and configure `deployment.gitea.resources` instead." + - it: fails when the removed `schedulerName` value is set + set: + schedulerName: stork + asserts: + - failedTemplate: + errorMessage: "`schedulerName` does no longer exist. Please refer to the changelog and configure `deployment.schedulerName` instead." - it: fails when the removed `tolerations` value is set set: tolerations: @@ -94,6 +100,7 @@ tests: resources: limits: cpu: 100m + schedulerName: stork tolerations: - key: database/type operator: Equal diff --git a/values.yaml b/values.yaml index 24da22b..a5a06c7 100644 --- a/values.yaml +++ b/values.yaml @@ -293,12 +293,6 @@ gatewayAPI: # maxSize: 100m -## Use an alternate scheduler, e.g. "stork". -## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ -## -## @param schedulerName Use an alternate scheduler, e.g. "stork" -schedulerName: "" - ## @section deployment deployment: ## @param deployment.enabled Enable the deployment of Gitea. @@ -381,6 +375,9 @@ deployment: # cpu: 100m # memory: 128Mi + ## @param deployment.schedulerName Use an alternate scheduler, e.g. "stork" + schedulerName: "" + ## @param deployment.terminationGracePeriodSeconds How long to wait until forcefully kill the pod terminationGracePeriodSeconds: 60