2023-06-16 21:10:56 +00:00
|
|
|
{{/* Make sure all variables are set properly */}}
|
|
|
|
{{- include "tc.v1.common.loader.init" . -}}
|
|
|
|
|
2023-06-18 15:15:53 +00:00
|
|
|
{{- include "nextcloud.validation" $ -}}
|
|
|
|
|
2023-06-16 21:10:56 +00:00
|
|
|
{{/* Render configmaps for all pods */}}
|
|
|
|
{{- $configmaps := include "nextcloud.configmaps" . | fromYaml -}}
|
|
|
|
{{- if $configmaps -}}
|
|
|
|
{{- $_ := mustMergeOverwrite .Values.configmap $configmaps -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2023-11-21 23:54:06 +00:00
|
|
|
{{/* Create hostAliases (resolve ingress host to Node/LB IP) */}}
|
|
|
|
{{- $hostAlias := (list (dict
|
|
|
|
"ip" .Values.nextcloud.general.accessIP
|
|
|
|
"hostnames" (
|
|
|
|
list (include "nextcloud.accesshost" $)
|
|
|
|
)
|
|
|
|
)) -}}
|
|
|
|
|
|
|
|
{{/* Add [hostAliases] to nextcloud and collabora pod */}}
|
|
|
|
{{- $_ := set .Values.workload.main.podSpec "hostAliases" $hostAlias -}}
|
|
|
|
{{- $_ := set .Values.workload.collabora.podSpec "hostAliases" $hostAlias -}}
|
|
|
|
|
2023-06-16 21:10:56 +00:00
|
|
|
{{/* Add [init perms] container to nextcloud */}}
|
|
|
|
{{- if not (get .Values.workload.main.podSpec "initContainers") -}}
|
|
|
|
{{- $_ := set .Values.workload.main.podSpec "initContainers" dict -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- $initPerms := (include "nextcloud.init.perms" . | fromYaml) -}}
|
|
|
|
{{- $_ := set .Values.workload.main.podSpec.initContainers "init-perms" $initPerms -}}
|
|
|
|
|
|
|
|
{{/* Add [wait nextcloud] container to nginx */}}
|
|
|
|
{{- if not (get .Values.workload.nginx.podSpec "initContainers") -}}
|
|
|
|
{{- $_ := set .Values.workload.nginx.podSpec "initContainers" dict -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $waitNextcloud := (include "nextcloud.wait.nextcloud" . | fromYaml) -}}
|
|
|
|
{{- $_ := set .Values.workload.nginx.podSpec.initContainers "wait-nextcloud" $waitNextcloud -}}
|
|
|
|
|
|
|
|
{{/* Disable [notify push] if requested */}}
|
|
|
|
{{- if not .Values.nextcloud.notify_push.enabled -}}
|
|
|
|
{{- $_ := set .Values.workload.notify "enabled" false -}}
|
|
|
|
{{- $_ := set .Values.service.notify "enabled" false -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{/* Add [wait nextcloud] container to notify push */}}
|
|
|
|
{{- if not (get .Values.workload.notify.podSpec "initContainers") -}}
|
|
|
|
{{- $_ := set .Values.workload.notify.podSpec "initContainers" dict -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $waitNextcloud := (include "nextcloud.wait.nextcloud" . | fromYaml) -}}
|
|
|
|
{{- $_ := set .Values.workload.notify.podSpec.initContainers "wait-nextcloud" $waitNextcloud -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/* Disable [clamav] if requested */}}
|
|
|
|
{{- if not .Values.nextcloud.clamav.enabled -}}
|
|
|
|
{{- $_ := set .Values.workload.clamav "enabled" false -}}
|
|
|
|
{{- $_ := set .Values.service.clamav "enabled" false -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/* Disable [previews] if requested */}}
|
|
|
|
{{- if or (not .Values.nextcloud.previews.imaginary) (not .Values.nextcloud.previews.enabled) -}}
|
|
|
|
{{- $_ := set .Values.workload.imaginary "enabled" false -}}
|
|
|
|
{{- $_ := set .Values.service.imaginary "enabled" false -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2023-06-18 15:15:53 +00:00
|
|
|
{{/* Disable [collabora] if requested */}}
|
|
|
|
{{- if not .Values.nextcloud.collabora.enabled -}}
|
|
|
|
{{- $_ := set .Values.workload.collabora "enabled" false -}}
|
|
|
|
{{- $_ := set .Values.service.collabora "enabled" false -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2023-06-16 21:10:56 +00:00
|
|
|
{{/* Create [cronjobs] defined */}}
|
|
|
|
{{- $cronjobs := include "nextcloud.cronjobs" . | fromYaml -}}
|
|
|
|
{{- if $cronjobs -}}
|
|
|
|
{{- $_ := mustMergeOverwrite .Values.workload $cronjobs -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2023-06-18 15:15:53 +00:00
|
|
|
{{/* TODO: Do we have to cleanup when something (eg Collabora) is disabled? */}}
|
|
|
|
{{- include "nextcloud.ingressInjector" $ -}}
|
|
|
|
|
2023-06-16 21:10:56 +00:00
|
|
|
{{/* Render the templates */}}
|
|
|
|
{{- include "tc.v1.common.loader.apply" . -}}
|