From a62339c3007c97e144ad41ab6c31968277c9deb4 Mon Sep 17 00:00:00 2001 From: Txomin Itoiz Date: Fri, 3 Oct 2025 10:56:27 +0200 Subject: [PATCH 1/3] feat: adds topologySpreadConstraints for nextcloud pod, cronjob pod and imaginary pod Signed-off-by: Txomin Itoiz --- charts/nextcloud/README.md | 44 ++++++++++--------- charts/nextcloud/templates/cronjob.yaml | 4 ++ charts/nextcloud/templates/deployment.yaml | 4 ++ .../templates/imaginary/deployment.yaml | 4 ++ charts/nextcloud/values.yaml | 4 ++ 5 files changed, 39 insertions(+), 21 deletions(-) diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index dd289e80..43c456bc 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -245,6 +245,7 @@ The following table lists the configurable parameters of the nextcloud chart and | `podLabels` | Labels to be added at 'pod' level | not set | | `podAnnotations` | Annotations to be added at 'pod' level | not set | | `dnsConfig` | Custom dnsConfig for nextcloud containers | `{}` | +| `topologySpreadConstraints` | TopologySpreadConstraints for nextcloud pod and cronjob pod | `{}` | ### Ingress #### Ingress Sticky-Sessions @@ -561,27 +562,28 @@ This section provides options to enable and configure the Collabora Online serve We include an optional external preview provider from [h2non/imaginary](https://github.com/h2non/imaginary). -| Parameter | Description | Default | -| ---------------------------------- | -------------------------------------------------------------------------------------- | ----------------- | -| `imaginary.enabled` | Start Imaginary | `false` | -| `imaginary.replicaCount` | Number of imaginary pod replicas to deploy | `1` | -| `imaginary.image.registry` | Imaginary image name | `docker.io` | -| `imaginary.image.repository` | Imaginary image name | `h2non/imaginary` | -| `imaginary.image.tag` | Imaginary image tag | `1.2.4` | -| `imaginary.image.pullPolicy` | Imaginary image pull policy | `IfNotPresent` | -| `imaginary.image.pullSecrets` | Imaginary image pull secrets | `nil` | -| `imaginary.podAnnotations` | Additional annotations for imaginary | `{}` | -| `imaginary.podLabels` | Additional labels for imaginary | `{}` | -| `imaginary.nodeSelector` | Imaginary pod nodeSelector | `{}` | -| `imaginary.tolerations` | Imaginary pod tolerations | `[]` | -| `imaginary.resources` | imaginary resources | `{}` | -| `imaginary.securityContext` | Optional security context for the Imaginary container | `nil` | -| `imaginary.podSecurityContext` | Optional security context for the Imaginary pod (applies to all containers in the pod) | `nil` | -| `imaginary.service.type` | Imaginary: Kubernetes Service type | `ClusterIP` | -| `imaginary.service.loadBalancerIP` | Imaginary: LoadBalancerIp for service type LoadBalancer | `nil` | -| `imaginary.service.nodePort` | Imaginary: NodePort for service type NodePort | `nil` | -| `imaginary.service.annotations` | Additional annotations for service imaginary | `{}` | -| `imaginary.service.labels` | Additional labels for service imaginary | `{}` | +| Parameter | Description | Default | +| ------------------------------------- | -------------------------------------------------------------------------------------- | ----------------- | +| `imaginary.enabled` | Start Imaginary | `false` | +| `imaginary.replicaCount` | Number of imaginary pod replicas to deploy | `1` | +| `imaginary.image.registry` | Imaginary image name | `docker.io` | +| `imaginary.image.repository` | Imaginary image name | `h2non/imaginary` | +| `imaginary.image.tag` | Imaginary image tag | `1.2.4` | +| `imaginary.image.pullPolicy` | Imaginary image pull policy | `IfNotPresent` | +| `imaginary.image.pullSecrets` | Imaginary image pull secrets | `nil` | +| `imaginary.podAnnotations` | Additional annotations for imaginary | `{}` | +| `imaginary.podLabels` | Additional labels for imaginary | `{}` | +| `imaginary.nodeSelector` | Imaginary pod nodeSelector | `{}` | +| `imaginary.tolerations` | Imaginary pod tolerations | `[]` | +| `imaginary.topologySpreadConstraints` | Imaginary pod topologySpreadConstraints | `[]` | +| `imaginary.resources` | imaginary resources | `{}` | +| `imaginary.securityContext` | Optional security context for the Imaginary container | `nil` | +| `imaginary.podSecurityContext` | Optional security context for the Imaginary pod (applies to all containers in the pod) | `nil` | +| `imaginary.service.type` | Imaginary: Kubernetes Service type | `ClusterIP` | +| `imaginary.service.loadBalancerIP` | Imaginary: LoadBalancerIp for service type LoadBalancer | `nil` | +| `imaginary.service.nodePort` | Imaginary: NodePort for service type NodePort | `nil` | +| `imaginary.service.annotations` | Additional annotations for service imaginary | `{}` | +| `imaginary.service.labels` | Additional labels for service imaginary | `{}` | > [!Note] diff --git a/charts/nextcloud/templates/cronjob.yaml b/charts/nextcloud/templates/cronjob.yaml index 63b8403c..9393475a 100644 --- a/charts/nextcloud/templates/cronjob.yaml +++ b/charts/nextcloud/templates/cronjob.yaml @@ -70,6 +70,10 @@ spec: tolerations: {{- toYaml . | nindent 12 }} {{- end }} + {{- with $.Values.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 12 }} + {{- end }} {{- end }}{{/* end with cronjob */}} volumes: - name: nextcloud-main diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index 87cac6ad..18aadb50 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -341,6 +341,10 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 8 }} + {{- end }} volumes: - name: nextcloud-main {{- if .Values.persistence.enabled }} diff --git a/charts/nextcloud/templates/imaginary/deployment.yaml b/charts/nextcloud/templates/imaginary/deployment.yaml index 6e8fc510..8ccca252 100644 --- a/charts/nextcloud/templates/imaginary/deployment.yaml +++ b/charts/nextcloud/templates/imaginary/deployment.yaml @@ -85,4 +85,8 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.imaginary.topologySpreadConstraints }} + topologySpreadConstraints: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index 991efb9f..acb357a3 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -781,6 +781,8 @@ nodeSelector: {} tolerations: [] +topologySpreadConstraints: [] + affinity: {} dnsConfig: {} @@ -816,6 +818,8 @@ imaginary: nodeSelector: {} # -- Imaginary pod tolerations tolerations: [] + # -- Imaginary pod topologySpreadConstraints + topologySpreadConstraints: [] # -- imaginary resources resources: {} From 453207ad882f6fde9444d10e3fa681b685012f7f Mon Sep 17 00:00:00 2001 From: Txomin Itoiz Date: Tue, 7 Oct 2025 10:41:31 +0200 Subject: [PATCH 2/3] feat: bump chart version Signed-off-by: Txomin Itoiz --- charts/nextcloud/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index 6d5bc1b9..a6357669 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 8.3.0 +version: 8.4.0 # renovate: image=docker.io/library/nextcloud appVersion: 32.0.0 description: A file sharing server that puts the control and security of your own data back into your hands. From 56248d7a3ce602ff05f18d6e480b0ed22529ca22 Mon Sep 17 00:00:00 2001 From: Txomin Itoiz Date: Tue, 7 Oct 2025 10:42:35 +0200 Subject: [PATCH 3/3] feat: add topologySpreadConstraints documentation Signed-off-by: Txomin Itoiz --- charts/nextcloud/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index acb357a3..159a422e 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -781,6 +781,7 @@ nodeSelector: {} tolerations: [] +# -- Nextcloud pod topologySpreadConstraints topologySpreadConstraints: [] affinity: {}