diff --git a/README.md b/README.md index 2268b17..1302609 100644 --- a/README.md +++ b/README.md @@ -1119,7 +1119,6 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo | `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" | `""` | -| `tolerations` | Tolerations for the deployment | `[]` | ### deployment @@ -1136,6 +1135,7 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo | `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.terminationGracePeriodSeconds` | How long to wait until forcefully kill the pod | `60` | +| `deployment.tolerations` | Tolerations of the Gitea deployment. | `[]` | | `deployment.topologySpreadConstraints` | TopologySpreadConstraints for the deployment | `[]` | ### Secret diff --git a/templates/gitea/deployment.yaml b/templates/gitea/deployment.yaml index 9280c9e..f03f71f 100644 --- a/templates/gitea/deployment.yaml +++ b/templates/gitea/deployment.yaml @@ -437,7 +437,7 @@ spec: topologySpreadConstraints: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.tolerations }} + {{- with .Values.deployment.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }} diff --git a/templates/gitea/deprecation.yaml b/templates/gitea/deprecation.yaml index 29b5fa1..d92f1a3 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 -}} + {{/* TOLERATIONS */}} + {{- if .Values.tolerations -}} + {{- fail "`tolerations` does no longer exist. Please refer to the changelog and configure `deployment.tolerations` instead." -}} + {{- end -}} + {{/* TOPOLOGY SPREAD CONSTRAINTS */}} {{- if .Values.topologySpreadConstraints -}} {{- fail "`topologySpreadConstraints` does no longer exist. Please refer to the changelog and configure `deployment.topologySpreadConstraints` instead." -}} diff --git a/unittests/helm/deployment/basic.yaml b/unittests/helm/deployment/basic.yaml index 5190945..a213c4c 100644 --- a/unittests/helm/deployment/basic.yaml +++ b/unittests/helm/deployment/basic.yaml @@ -139,6 +139,27 @@ tests: - equal: path: spec.template.spec.priorityClassName value: high-priority + - it: tolerations are undefined + template: templates/gitea/deployment.yaml + asserts: + - notExists: + path: spec.template.spec.tolerations + - it: tolerations are defined + template: templates/gitea/deployment.yaml + set: + deployment.tolerations: + - key: database/type + operator: Equal + value: postgres + effect: NoSchedule + asserts: + - equal: + path: spec.template.spec.tolerations + value: + - key: database/type + operator: Equal + value: postgres + effect: NoSchedule - it: topologySpreadConstraints are undefined template: templates/gitea/deployment.yaml asserts: diff --git a/unittests/helm/deployment/deprecations.yaml b/unittests/helm/deployment/deprecations.yaml index 62407b9..146548a 100644 --- a/unittests/helm/deployment/deprecations.yaml +++ b/unittests/helm/deployment/deprecations.yaml @@ -60,6 +60,16 @@ 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 `tolerations` value is set + set: + tolerations: + - key: database/type + operator: Equal + value: postgres + effect: NoSchedule + asserts: + - failedTemplate: + errorMessage: "`tolerations` does no longer exist. Please refer to the changelog and configure `deployment.tolerations` instead." - it: fails when the removed `topologySpreadConstraints` value is set set: topologySpreadConstraints: @@ -84,6 +94,11 @@ tests: resources: limits: cpu: 100m + tolerations: + - key: database/type + operator: Equal + value: postgres + effect: NoSchedule topologySpreadConstraints: - topologyKey: kubernetes.io/hostname asserts: diff --git a/values.yaml b/values.yaml index 3d2fb35..24da22b 100644 --- a/values.yaml +++ b/values.yaml @@ -299,9 +299,6 @@ gatewayAPI: ## @param schedulerName Use an alternate scheduler, e.g. "stork" schedulerName: "" -## @param tolerations Tolerations for the deployment -tolerations: [] - ## @section deployment deployment: ## @param deployment.enabled Enable the deployment of Gitea. @@ -387,6 +384,13 @@ deployment: ## @param deployment.terminationGracePeriodSeconds How long to wait until forcefully kill the pod terminationGracePeriodSeconds: 60 + ## @param deployment.tolerations Tolerations of the Gitea deployment. + tolerations: [] + # - key: database/type + # operator: Equal + # value: postgres + # effect: NoSchedule + ## @param deployment.topologySpreadConstraints TopologySpreadConstraints for the deployment topologySpreadConstraints: [] # - topologyKey: kubernetes.io/hostname