feat(deployment)!: move replicaCount to deployment.replicas
The top-level `replicaCount` value only ever set the replica count 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`, `schedulerName`, `strategy`, `tolerations` and `topologySpreadConstraints`. The key was renamed from `replicaCount` to `replicas` at the same time. Every other key inside the `deployment` dict mirrors the name of the corresponding Kubernetes field, so `deployment.replicas` maps one to one onto `spec.replicas` and removes the need to remember a chart-specific alias. A deprecation check fails the release when the removed top-level value is still set. Silently ignoring it would be severe here: the release would scale back down to a single replica without any warning, and the HA guards in the PVC and config templates, which key off the replica count, would no longer apply. BREAKING CHANGE: `replicaCount` no longer exists. Use `deployment.replicas` instead. Installations that still set `replicaCount` will fail unless `checkDeprecation` is set to `false`. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -1007,6 +1007,7 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
|
|||||||
| `deployment.gitea.resources` | Compute Resources required by Gitea container. Cannot be updated. | `nil` |
|
| `deployment.gitea.resources` | Compute Resources required by Gitea container. Cannot be updated. | `nil` |
|
||||||
| `deployment.nodeSelector` | NodeSelector for the deployment | `{}` |
|
| `deployment.nodeSelector` | NodeSelector for the deployment | `{}` |
|
||||||
| `deployment.priorityClassName` | priorityClassName for the deployment | `""` |
|
| `deployment.priorityClassName` | priorityClassName for the deployment | `""` |
|
||||||
|
| `deployment.replicas` | Number of replicas for the Gitea deployment. | `1` |
|
||||||
| `deployment.resources` | Resources is the total amount of CPU and Memory resources required by all containers in the pod. | `{}` |
|
| `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.schedulerName` | Use an alternate scheduler, e.g. "stork" | `""` |
|
||||||
| `deployment.strategy.type` | Deployment strategy used to replace old pods, either `RollingUpdate` or `Recreate`. | `RollingUpdate` |
|
| `deployment.strategy.type` | Deployment strategy used to replace old pods, either `RollingUpdate` or `Recreate`. | `RollingUpdate` |
|
||||||
@@ -1058,7 +1059,6 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
|
|||||||
| `ingress.hosts[0].paths[0].path` | Default Ingress path | `/` |
|
| `ingress.hosts[0].paths[0].path` | Default Ingress path | `/` |
|
||||||
| `ingress.tls` | Ingress tls settings | `[]` |
|
| `ingress.tls` | Ingress tls settings | `[]` |
|
||||||
| `namespace` | An explicit namespace to deploy Gitea into. Defaults to the release namespace if not specified | `""` |
|
| `namespace` | An explicit namespace to deploy Gitea into. Defaults to the release namespace if not specified | `""` |
|
||||||
| `replicaCount` | number of replicas for the deployment | `1` |
|
|
||||||
|
|
||||||
### Network
|
### Network
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ They might cost a bit more than using a self-hosted k8s variant but are usually
|
|||||||
Also they can be centrally managed and are not linked to the Gitea helm chart or namespace.
|
Also they can be centrally managed and are not linked to the Gitea helm chart or namespace.
|
||||||
Please consider using external services before you start with your Gitea HA setup, it will make your life (and the life of the Gitea maintainers) easier.
|
Please consider using external services before you start with your Gitea HA setup, it will make your life (and the life of the Gitea maintainers) easier.
|
||||||
|
|
||||||
This helm chart tries to help as much as possible to simplify and assert the provisioning of a HA-ready Gitea instance by implementing smart conditionals if `replicaCount` is set to a value > 1.
|
This helm chart tries to help as much as possible to simplify and assert the provisioning of a HA-ready Gitea instance by implementing smart conditionals if `deployment.replicas` is set to a value > 1.
|
||||||
Nevertheless, we cannot guarantee for every possible combination of Gitea settings to work together perfectly in a HA setup.
|
Nevertheless, we cannot guarantee for every possible combination of Gitea settings to work together perfectly in a HA setup.
|
||||||
As a general advice, we recommend to have a test environment aside on which to test possible changes/upgrades before applying these to a production installation.
|
As a general advice, we recommend to have a test environment aside on which to test possible changes/upgrades before applying these to a production installation.
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ metadata:
|
|||||||
{{- toYaml .Values.deployment.labels | nindent 4 }}
|
{{- toYaml .Values.deployment.labels | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
replicas: {{ .Values.replicaCount }}
|
replicas: {{ .Values.deployment.replicas }}
|
||||||
strategy:
|
strategy:
|
||||||
type: {{ .Values.deployment.strategy.type }}
|
type: {{ .Values.deployment.strategy.type }}
|
||||||
{{- if eq .Values.deployment.strategy.type "RollingUpdate" }}
|
{{- if eq .Values.deployment.strategy.type "RollingUpdate" }}
|
||||||
|
|||||||
@@ -70,6 +70,11 @@
|
|||||||
{{- fail "`resources` does no longer exist. Please refer to the changelog and configure `deployment.gitea.resources` instead." -}}
|
{{- fail "`resources` does no longer exist. Please refer to the changelog and configure `deployment.gitea.resources` instead." -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/* REPLICA COUNT */}}
|
||||||
|
{{- if .Values.replicaCount -}}
|
||||||
|
{{- fail "`replicaCount` does no longer exist. Please refer to the changelog and configure `deployment.replicas` instead." -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{/* SCHEDULER NAME */}}
|
{{/* SCHEDULER NAME */}}
|
||||||
{{- if .Values.schedulerName -}}
|
{{- if .Values.schedulerName -}}
|
||||||
{{- fail "`schedulerName` does no longer exist. Please refer to the changelog and configure `deployment.schedulerName` instead." -}}
|
{{- fail "`schedulerName` does no longer exist. Please refer to the changelog and configure `deployment.schedulerName` instead." -}}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ metadata:
|
|||||||
{{ .Values.persistence.labels | toYaml | indent 4}}
|
{{ .Values.persistence.labels | toYaml | indent 4}}
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
{{- if gt (.Values.replicaCount | int) 1 }}
|
{{- if gt (.Values.deployment.replicas | int) 1 }}
|
||||||
- ReadWriteMany
|
- ReadWriteMany
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- .Values.persistence.accessModes | toYaml | nindent 4 }}
|
{{- .Values.persistence.accessModes | toYaml | nindent 4 }}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ stringData:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- /* multiple replicas assertions */ -}}
|
{{- /* multiple replicas assertions */ -}}
|
||||||
{{- if gt (.Values.replicaCount | int) 1 -}}
|
{{- if gt (.Values.deployment.replicas | int) 1 -}}
|
||||||
{{- if .Values.gitea.config.cron -}}
|
{{- if .Values.gitea.config.cron -}}
|
||||||
{{- if .Values.gitea.config.cron.GIT_GC_REPOS -}}
|
{{- if .Values.gitea.config.cron.GIT_GC_REPOS -}}
|
||||||
{{- if eq .Values.gitea.config.cron.GIT_GC_REPOS.ENABLED true -}}
|
{{- if eq .Values.gitea.config.cron.GIT_GC_REPOS.ENABLED true -}}
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ tests:
|
|||||||
- it: fails with multiple replicas and "GIT_GC_REPOS" enabled
|
- it: fails with multiple replicas and "GIT_GC_REPOS" enabled
|
||||||
template: templates/gitea/secret_config.yaml
|
template: templates/gitea/secret_config.yaml
|
||||||
set:
|
set:
|
||||||
replicaCount: 2
|
deployment:
|
||||||
|
replicas: 2
|
||||||
persistence:
|
persistence:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteMany
|
- ReadWriteMany
|
||||||
@@ -29,14 +30,16 @@ tests:
|
|||||||
- it: fails with multiple replicas and RWX file system not set
|
- it: fails with multiple replicas and RWX file system not set
|
||||||
template: templates/gitea/secret_config.yaml
|
template: templates/gitea/secret_config.yaml
|
||||||
set:
|
set:
|
||||||
replicaCount: 2
|
deployment:
|
||||||
|
replicas: 2
|
||||||
asserts:
|
asserts:
|
||||||
- failedTemplate:
|
- failedTemplate:
|
||||||
errorMessage: "When using multiple replicas, a RWX file system is required and persistence.accessModes[0] must be set to ReadWriteMany."
|
errorMessage: "When using multiple replicas, a RWX file system is required and persistence.accessModes[0] must be set to ReadWriteMany."
|
||||||
- it: fails with multiple replicas and bleve issue indexer
|
- it: fails with multiple replicas and bleve issue indexer
|
||||||
template: templates/gitea/secret_config.yaml
|
template: templates/gitea/secret_config.yaml
|
||||||
set:
|
set:
|
||||||
replicaCount: 2
|
deployment:
|
||||||
|
replicas: 2
|
||||||
persistence:
|
persistence:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteMany
|
- ReadWriteMany
|
||||||
@@ -50,7 +53,8 @@ tests:
|
|||||||
- it: fails with multiple replicas and bleve repo indexer
|
- it: fails with multiple replicas and bleve repo indexer
|
||||||
template: templates/gitea/secret_config.yaml
|
template: templates/gitea/secret_config.yaml
|
||||||
set:
|
set:
|
||||||
replicaCount: 2
|
deployment:
|
||||||
|
replicas: 2
|
||||||
persistence:
|
persistence:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteMany
|
- ReadWriteMany
|
||||||
|
|||||||
@@ -60,6 +60,12 @@ tests:
|
|||||||
asserts:
|
asserts:
|
||||||
- failedTemplate:
|
- failedTemplate:
|
||||||
errorMessage: "`resources` does no longer exist. Please refer to the changelog and configure `deployment.gitea.resources` instead."
|
errorMessage: "`resources` does no longer exist. Please refer to the changelog and configure `deployment.gitea.resources` instead."
|
||||||
|
- it: fails when the removed `replicaCount` value is set
|
||||||
|
set:
|
||||||
|
replicaCount: 2
|
||||||
|
asserts:
|
||||||
|
- failedTemplate:
|
||||||
|
errorMessage: "`replicaCount` does no longer exist. Please refer to the changelog and configure `deployment.replicas` instead."
|
||||||
- it: fails when the removed `schedulerName` value is set
|
- it: fails when the removed `schedulerName` value is set
|
||||||
set:
|
set:
|
||||||
schedulerName: stork
|
schedulerName: stork
|
||||||
@@ -104,6 +110,7 @@ tests:
|
|||||||
nodeSelector:
|
nodeSelector:
|
||||||
foo: bar
|
foo: bar
|
||||||
priorityClassName: high-priority
|
priorityClassName: high-priority
|
||||||
|
replicaCount: 2
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
+3
-3
@@ -90,6 +90,9 @@ deployment:
|
|||||||
## @param deployment.priorityClassName priorityClassName for the deployment
|
## @param deployment.priorityClassName priorityClassName for the deployment
|
||||||
priorityClassName: ""
|
priorityClassName: ""
|
||||||
|
|
||||||
|
## @param deployment.replicas Number of replicas for the Gitea deployment.
|
||||||
|
replicas: 1
|
||||||
|
|
||||||
## @param deployment.resources Resources is the total amount of CPU and Memory resources required by all containers in the pod.
|
## @param deployment.resources Resources is the total amount of CPU and Memory resources required by all containers in the pod.
|
||||||
## @skip deployment.resources.limits Limits describes the maximum amount of compute resources allowed.
|
## @skip deployment.resources.limits Limits describes the maximum amount of compute resources allowed.
|
||||||
## @skip deployment.resources.requests Requests describes the minimum amount of compute resources required.
|
## @skip deployment.resources.requests Requests describes the minimum amount of compute resources required.
|
||||||
@@ -245,9 +248,6 @@ ingress:
|
|||||||
## @param namespace An explicit namespace to deploy gitea into. Defaults to the release namespace if not specified
|
## @param namespace An explicit namespace to deploy gitea into. Defaults to the release namespace if not specified
|
||||||
namespace: ""
|
namespace: ""
|
||||||
|
|
||||||
## @param replicaCount number of replicas for the deployment
|
|
||||||
replicaCount: 1
|
|
||||||
|
|
||||||
## @section Network
|
## @section Network
|
||||||
## @param clusterDomain Domain of the Cluster. Domain is part of internally issued certificates.
|
## @param clusterDomain Domain of the Cluster. Domain is part of internally issued certificates.
|
||||||
clusterDomain: cluster.local
|
clusterDomain: cluster.local
|
||||||
|
|||||||
Reference in New Issue
Block a user