|
| 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 .commandCronJob | 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 }} |
0 commit comments