Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.

Commit 8c13b16

Browse files
pull[bot]qdiiRisingOpsNinjawrenixManuelraa
authored
[pull] main from nextcloud:main (#72)
* feat(nextcloud): Allow specifying service session affinity in helm chart Signed-off-by: Victor Lavaud <victor.lavaud@pm.me> * feat(nextcloud): Allow specifying service session affinity configuration in helm chart Signed-off-by: Victor Lavaud <victor.lavaud@pm.me> * feat(nextcloud): add support for external Redis host Signed-off-by: RisingOpsNinja <175097282+RisingOpsNinja@users.noreply.github.com> * Bump patch version Signed-off-by: RisingOpsNinja <175097282+RisingOpsNinja@users.noreply.github.com> * Bump patch version Signed-off-by: RisingOpsNinja <175097282+RisingOpsNinja@users.noreply.github.com> * feat: add option to run cronjob as CronJob instead of sidecar Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * fix: cronjob should use correct command Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * fix: use cronjob resources Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * fix: set restartPolicy to Never Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * chore: allow setting affinity for cronjob Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * chore: verbose cronjob by default Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * chore!: review comments BREAKING CHANGE: `cronjob.command` was renamed to `cronjob.commandCrondSidecar` to avoid confusion with the cronjob command. Please update your `values.yaml` accordingly. Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * chore: add additional cronjob configuration options Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * fix: backoffLimit should be set on job not pod Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * refactor: introduce cronjob.type Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * test: add test values for cronjob Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * fix: template error when using defaults for both cronjob types Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * docs: improve sentence in conrjob documentation Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * docs: fix description of breaking change in changelog Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> * fix(nextcloud): cronjob template not matching values.yaml nextcloud#772 Changelog: fixed Signed-off-by: GeorgeRaven <GeorgeRavenCommunity@pm.me> --------- Signed-off-by: Victor Lavaud <victor.lavaud@pm.me> Signed-off-by: RisingOpsNinja <175097282+RisingOpsNinja@users.noreply.github.com> Signed-off-by: Manuelraa <kontakt@manuel-rapp.de> Signed-off-by: GeorgeRaven <GeorgeRavenCommunity@pm.me> Co-authored-by: Victor Lavaud <victor.lavaud@pm.me> Co-authored-by: RisingOpsNinja <175097282+RisingOpsNinja@users.noreply.github.com> Co-authored-by: WrenIX <133280015+wrenix@users.noreply.github.com> Co-authored-by: Manuelraa <kontakt@manuel-rapp.de> Co-authored-by: Dr. George Raven <DreamingRaven@users.noreply.github.com>
1 parent 55c8736 commit 8c13b16

File tree

10 files changed

+459
-200
lines changed

10 files changed

+459
-200
lines changed

charts/nextcloud/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ This Helm-Chart increase there major version on every breaking change (or major
44

55
Here we list all major versions and their breaking changes for migration.
66

7+
## v8
8+
- `cronjob.command` was renamed to `cronjob.sidecar.command` to avoid confusion with the cronjob command. Please update your `values.yaml` accordingly.
9+
710
## v7
811

912
- update redis to v20 (see [CHANGELOG](https://github.com/bitnami/charts/blob/main/bitnami/redis/CHANGELOG.md#2000-2024-08-09))

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: 7.0.2
3+
version: 8.0.1
44
# renovate: image=docker.io/library/nextcloud
55
appVersion: 31.0.8
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: 171 additions & 149 deletions
Large diffs are not rendered by default.

charts/nextcloud/templates/_helpers.tpl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,23 @@ Redis env vars
236236
value: {{ .Values.redis.auth.password }}
237237
{{- end }}
238238
{{- end }}
239+
{{- else if .Values.externalRedis.enabled }}
240+
- name: REDIS_HOST
241+
value: {{ .Values.externalRedis.host | quote }}
242+
- name: REDIS_HOST_PORT
243+
value: {{ .Values.externalRedis.port | quote }}
244+
{{- if .Values.externalRedis.existingSecret.enabled }}
245+
{{- if and .Values.externalRedis.existingSecret.secretName .Values.externalRedis.existingSecret.passwordKey }}
246+
- name: REDIS_HOST_PASSWORD
247+
valueFrom:
248+
secretKeyRef:
249+
name: {{ .Values.externalRedis.existingSecret.secretName | quote }}
250+
key: {{ .Values.externalRedis.existingSecret.passwordKey | quote }}
251+
{{- end }}
252+
{{- else if .Values.externalRedis.password }}
253+
- name: REDIS_HOST_PASSWORD
254+
value: {{ .Values.externalRedis.password | quote }}
255+
{{- end }}
239256
{{- end }}{{/* end if redis.enabled */}}
240257
{{/*
241258
S3 as primary object store env vars
@@ -431,4 +448,4 @@ app.kubernetes.io/managed-by: {{ .rootContext.Release.Service }}
431448
{{- with .rootContext.Chart.AppVersion }}
432449
app.kubernetes.io/version: {{ quote . }}
433450
{{- end }}
434-
{{- end -}}
451+
{{- end -}}
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
{{- if and .Values.cronjob.enabled (eq .Values.cronjob.type "cronjob") }}
3+
{{- with .Values.cronjob.cronjob }}{{/* begin with cronjob */}}
4+
apiVersion: batch/v1
5+
kind: CronJob
6+
metadata:
7+
name: {{ template "nextcloud.fullname" $ }}-cron
8+
labels:
9+
{{- include "nextcloud.labels" ( dict "component" "cron" "rootContext" $ ) | nindent 4 }}
10+
{{- with .labels }}
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
13+
{{- with .annotations }}
14+
annotations:
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
spec:
18+
schedule: {{ .schedule | quote }}
19+
concurrencyPolicy: Forbid
20+
successfulJobsHistoryLimit: {{ .successfulJobsHistoryLimit }}
21+
failedJobsHistoryLimit: {{ .failedJobsHistoryLimit }}
22+
jobTemplate:
23+
metadata:
24+
labels:
25+
{{- include "nextcloud.selectorLabels" ( dict "component" "cron" "rootContext" $ ) | nindent 8 }}
26+
{{- with $.Values.podLabels }}
27+
{{- toYaml . | nindent 8 }}
28+
{{- end }}
29+
spec:
30+
backoffLimit: {{ .backoffLimit }}
31+
template:
32+
spec:
33+
restartPolicy: Never
34+
containers:
35+
- name: {{ $.Chart.Name }}-cron
36+
image: {{ include "nextcloud.image" $ }}
37+
imagePullPolicy: {{ $.Values.image.pullPolicy }}
38+
command:
39+
{{- toYaml .command | nindent 16 }}
40+
env:
41+
{{- include "nextcloud.env" $ | nindent 16 }}
42+
resources:
43+
{{- toYaml .resources | nindent 16 }}
44+
{{- with .securityContext }}
45+
securityContext:
46+
{{- toYaml . | nindent 16 }}
47+
{{- end }}
48+
volumeMounts:
49+
{{- include "nextcloud.volumeMounts" $ | trim | nindent 16 }}
50+
{{- with $.Values.nodeSelector }}
51+
nodeSelector:
52+
{{- toYaml . | nindent 12 }}
53+
{{- end }}
54+
{{- with .affinity }}
55+
affinity:
56+
{{- toYaml . | nindent 12 }}
57+
{{- end }}
58+
{{- with $.Values.tolerations }}
59+
tolerations:
60+
{{- toYaml . | nindent 12 }}
61+
{{- end }}
62+
{{- end }}{{/* end with cronjob */}}
63+
volumes:
64+
- name: nextcloud-main
65+
{{- if .Values.persistence.enabled }}
66+
persistentVolumeClaim:
67+
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud{{- end }}
68+
{{- else }}
69+
emptyDir: {}
70+
{{- end }}
71+
{{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }}
72+
- name: nextcloud-data
73+
persistentVolumeClaim:
74+
claimName: {{ if .Values.persistence.nextcloudData.existingClaim }}{{ .Values.persistence.nextcloudData.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud-data{{- end }}
75+
{{- end }}
76+
{{- if .Values.nextcloud.configs }}
77+
- name: nextcloud-config
78+
configMap:
79+
name: {{ template "nextcloud.fullname" . }}-config
80+
{{- end }}
81+
{{- if .Values.nextcloud.phpConfigs }}
82+
- name: nextcloud-phpconfig
83+
configMap:
84+
name: {{ template "nextcloud.fullname" . }}-phpconfig
85+
{{- end }}
86+
{{- if .Values.nginx.enabled }}
87+
- name: nextcloud-nginx-config
88+
configMap:
89+
name: {{ template "nextcloud.fullname" . }}-nginxconfig
90+
{{- end }}
91+
{{- if not (values .Values.nextcloud.hooks | compact | empty) }}
92+
- name: nextcloud-hooks
93+
configMap:
94+
name: {{ template "nextcloud.fullname" . }}-hooks
95+
defaultMode: 0o755
96+
{{- end }}
97+
{{- with .Values.nextcloud.extraVolumes }}
98+
{{- toYaml . | nindent 12 }}
99+
{{- end }}
100+
securityContext:
101+
{{- with .Values.securityContext }}
102+
{{- toYaml . | nindent 12 }}
103+
{{- end }}
104+
{{- with .Values.nextcloud.podSecurityContext }}
105+
{{- toYaml . | nindent 12 }}
106+
{{- else }}
107+
{{- if .Values.nginx.enabled }}
108+
# Will mount configuration files as www-data (id: 82) for nextcloud
109+
fsGroup: 82
110+
{{- else }}
111+
# Will mount configuration files as www-data (id: 33) for nextcloud
112+
fsGroup: 33
113+
{{- end }}
114+
{{- end }}{{/* end-with podSecurityContext */}}
115+
{{- if .Values.rbac.enabled }}
116+
serviceAccountName: {{ .Values.rbac.serviceaccount.name }}
117+
{{- end }}
118+
{{- with .Values.dnsConfig }}
119+
dnsConfig:
120+
{{- toYaml . | nindent 12 }}
121+
{{- end }}
122+
{{- end }}

charts/nextcloud/templates/deployment.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,14 @@ spec:
240240
{{- toYaml . | nindent 12 }}
241241
{{- end }}
242242
{{- end }}{{/* end-if nginx.enabled */}}
243-
{{- if .Values.cronjob.enabled }}
244-
- name: {{ .Chart.Name }}-cron
245-
image: {{ include "nextcloud.image" . }}
246-
imagePullPolicy: {{ .Values.image.pullPolicy }}
243+
{{- if and .Values.cronjob.enabled (eq .Values.cronjob.type "sidecar") }}
244+
{{- with .Values.cronjob.sidecar }}
245+
- name: {{ $.Chart.Name }}-cron
246+
image: {{ include "nextcloud.image" $ }}
247+
imagePullPolicy: {{ $.Values.image.pullPolicy }}
247248
command:
248-
{{- toYaml .Values.cronjob.command | nindent 12 }}
249-
{{- with .Values.cronjob.lifecycle }}
249+
{{- toYaml .command | nindent 12 }}
250+
{{- with .lifecycle }}
250251
lifecycle:
251252
{{- with .postStartCommand }}
252253
postStart:
@@ -262,15 +263,16 @@ spec:
262263
{{- end }}
263264
{{- end }}
264265
env:
265-
{{- include "nextcloud.env" . | nindent 12 }}
266+
{{- include "nextcloud.env" $ | nindent 12 }}
266267
resources:
267-
{{- toYaml .Values.cronjob.resources | nindent 12 }}
268-
{{- with .Values.cronjob.securityContext }}
268+
{{- toYaml .resources | nindent 12 }}
269+
{{- with .securityContext }}
269270
securityContext:
270271
{{- toYaml . | nindent 12 }}
271272
{{- end }}
272273
volumeMounts:
273-
{{- include "nextcloud.volumeMounts" . | trim | nindent 12 }}
274+
{{- include "nextcloud.volumeMounts" $ | trim | nindent 12 }}
275+
{{- end }}
274276
{{- end }}{{/* end-if cronjob.enabled */}}
275277
{{- with .Values.nextcloud.extraSidecarContainers }}
276278
{{- toYaml . | nindent 8 }}

charts/nextcloud/templates/service.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ spec:
2323
{{- with .Values.service.ipFamilyPolicy }}
2424
ipFamilyPolicy: {{ . }}
2525
{{- end }}
26+
{{- with .Values.service.sessionAffinity }}
27+
sessionAffinity: {{ . }}
28+
{{- end }}
29+
{{- with .Values.service.sessionAffinityConfig }}
30+
sessionAffinityConfig:
31+
{{- toYaml . | nindent 4 }}
32+
{{- end }}
2633
ports:
2734
- port: {{ .Values.service.port }}
2835
targetPort: {{ .Values.nextcloud.containerPort }}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
cronjob:
2+
enabled: true
3+
type: cronjob
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
cronjob:
2+
enabled: true

0 commit comments

Comments
 (0)