Skip to content

Commit e1a1945

Browse files
fix(nextcloud): Add support for priorityClassName #789
* Add support for priorityClassName The chart now has one "main" `.Values.priorityClassName`, which is the default for everything deployed in the main chart (i.e. the default does not extend to `mariadb`, `redis`, `collabora-online` etc). The main priority class can be overridden for the cronjob and imaginary Closes #178 Signed-off-by: Karl E. Jorgensen <karl@jorgensen.org.uk>
1 parent 6f84aa0 commit e1a1945

File tree

6 files changed

+33
-1
lines changed

6 files changed

+33
-1
lines changed

charts/nextcloud/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: nextcloud
3-
version: 8.5.4
3+
version: 8.5.5
44
# renovate: image=docker.io/library/nextcloud
55
appVersion: 32.0.2
66
description: A file sharing server that puts the control and security of your own data back into your hands.

charts/nextcloud/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ The following table lists the configurable parameters of the nextcloud chart and
174174
| `nextcloud.securityContext` | Optional security context for the NextCloud container | `nil` |
175175
| `nextcloud.podSecurityContext` | Optional security context for the NextCloud pod (applies to all containers in the pod) | `nil` |
176176
| `nextcloud.postgreSqlInitContainer.securityContext` | Set postgresql initContainer securityContext parameters. | `{}` |
177+
| `nextcloud.priorityClassName` | Priority Class for nextcloud. Defaults to .priorityClassName | `nil` |
177178
| `nginx.enabled` | Enable nginx (requires you use php-fpm image) | `false` |
178179
| `nginx.image.repository` | nginx Image name, e.g. use `nginxinc/nginx-unprivileged` for rootless container | `nginx` |
179180
| `nginx.image.tag` | nginx Image tag | `alpine` |
@@ -219,6 +220,7 @@ The following table lists the configurable parameters of the nextcloud chart and
219220
| `cronjob.cronjob.backoffLimit` | The number of retries before marking a job as failed | `1` |
220221
| `cronjob.cronjob.affinity` | The affinity settings for the cron job | `{}` |
221222
| `cronjob.cronjob.resources` | The resource requests/limits for the cron job | `{}` |
223+
| `cronjob.cronjob.priorityClassName` | Priority Class for cronjob. Defaults to .priorityClassName | `nil` |
222224
| `cronjob.cronjob.securityContext` | Optional security context for cronjobs | `nil` |
223225
| `cronjob.cronjob.command` | The command the cronjob executes | `["php", "-f", "/var/www/html/cron.php", "--", "--verbose"]` |
224226
| `service.type` | Kubernetes Service type | `ClusterIP` |
@@ -232,6 +234,7 @@ The following table lists the configurable parameters of the nextcloud chart and
232234
| `phpClientHttpsFix.enabled` | Sets OVERWRITEPROTOCOL for https ingress redirect | `false` |
233235
| `phpClientHttpsFix.protocol` | Sets OVERWRITEPROTOCOL for https ingress redirect | `https` |
234236
| `resources` | CPU/Memory resource requests/limits | `{}` |
237+
| `priorityClassName` | Priority Class for pods | `nil` |
235238
| `rbac.enabled` | Enable Role and rolebinding for priveledged PSP | `false` |
236239
| `rbac.serviceaccount.create` | Wether to create a serviceaccount or use an existing one (requires rbac) | `true` |
237240
| `rbac.serviceaccount.name` | The name of the sevice account that the deployment will use (requires rbac) | `nextcloud-serviceaccount` |
@@ -579,6 +582,7 @@ We include an optional external preview provider from [h2non/imaginary](https://
579582
| `imaginary.tolerations` | Imaginary pod tolerations | `[]` |
580583
| `imaginary.topologySpreadConstraints` | Imaginary pod topologySpreadConstraints | `[]` |
581584
| `imaginary.resources` | imaginary resources | `{}` |
585+
| `imaginary.priorityClassName` | Imaginary pod Priority Class. Defaults to .priorityClassName | `nil` |
582586
| `imaginary.securityContext` | Optional security context for the Imaginary container | `nil` |
583587
| `imaginary.podSecurityContext` | Optional security context for the Imaginary pod (applies to all containers in the pod) | `nil` |
584588
| `imaginary.service.type` | Imaginary: Kubernetes Service type | `ClusterIP` |

charts/nextcloud/templates/cronjob.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ spec:
6262
nodeSelector:
6363
{{- toYaml . | nindent 12 }}
6464
{{- end }}
65+
{{- with $.Values.cronjob.cronjob.priorityClassName | default $.Values.priorityClassName }}
66+
priorityClassName: {{ . }}
67+
{{- end }}
6568
{{- with .affinity }}
6669
affinity:
6770
{{- toYaml . | nindent 12 }}

charts/nextcloud/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@ spec:
281281
nodeSelector:
282282
{{- toYaml . | nindent 8 }}
283283
{{- end }}
284+
{{- with $.Values.nextcloud.priorityClassName | default $.Values.priorityClassName }}
285+
priorityClassName: {{ . }}
286+
{{- end }}
284287
{{- if or .Values.nextcloud.extraInitContainers .Values.mariadb.enabled .Values.postgresql.enabled }}
285288
initContainers:
286289
{{- with .Values.nextcloud.extraInitContainers }}

charts/nextcloud/templates/imaginary/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,7 @@ spec:
8989
topologySpreadConstraints:
9090
{{- toYaml . | nindent 8 }}
9191
{{- end }}
92+
{{- with .Values.imaginary.priorityClassName | default .Values.priorityClassName }}
93+
priorityClassName: {{ . }}
94+
{{- end }}
9295
{{- end }}

charts/nextcloud/values.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ nextcloud:
327327
# Set postgresql initContainer securityContext parameters. For example, you may need to define runAsNonRoot directive
328328
securityContext: {}
329329

330+
# -- priority class for nextcloud.
331+
# Overrides .Values.priorityClassName
332+
priorityClassName: ""
333+
330334
nginx:
331335
## You need to set an fpm version of the image for nextcloud if you want to use nginx!
332336
enabled: false
@@ -675,6 +679,11 @@ cronjob:
675679
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
676680
##
677681
resources: {}
682+
683+
# -- priority class for the cron job.
684+
# Overrides .Values.priorityClassName
685+
priorityClassName: ""
686+
678687
# Allow configuration of lifecycle hooks
679688
# ref: https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/
680689
# Set securityContext parameters. For example, you may need to define runAsNonRoot directive
@@ -755,6 +764,12 @@ resources: {}
755764
# cpu: 100m
756765
# memory: 128Mi
757766

767+
# -- Priority class for pods. This is the _default_
768+
# priority class for pods created by this deployment - it may be
769+
# overridden by more specific instances of priorityClassName -
770+
# e.g. cronjob.cronjob.priorityClassName
771+
priorityClassName: ""
772+
758773
## Liveness and readiness probe values
759774
## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
760775
##
@@ -837,6 +852,10 @@ imaginary:
837852
# -- imaginary resources
838853
resources: {}
839854

855+
# -- priority class for imaginary.
856+
# Overrides .Values.priorityClassName
857+
priorityClassName: ""
858+
840859
# -- Optional security context for the Imaginary container
841860
securityContext:
842861
runAsUser: 1000

0 commit comments

Comments
 (0)