mirror of
https://github.com/truenas/charts.git
synced 2026-11-14 06:48:09 +00:00
71 lines
3.6 KiB
YAML
71 lines
3.6 KiB
YAML
{{ $postgres_values := (. | mustDeepCopy) }}
|
|
{{ $_ := set $postgres_values "common" (dict "nameSuffix" "postgres") }}
|
|
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ template "common.names.fullname" . }}
|
|
labels: {{ include "common.labels" . | nindent 4 }}
|
|
annotations: {{ include "common.annotations" . | nindent 4 }}
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: {{ .Values.nextcloud.strategy }}
|
|
selector:
|
|
matchLabels: {{ include "common.labels.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
labels: {{ include "common.labels.selectorLabels" . | nindent 8 }}
|
|
annotations: {{ include "common.annotations" . | nindent 8 }}
|
|
spec:
|
|
initContainers:
|
|
- name: init-postgresdb
|
|
image: {{ template "postgres.imageName" . }}
|
|
command: ['sh', '-c', "until pg_isready -h {{ template "common.names.fullname" $postgres_values }}; do echo waiting for postgres; sleep 2; done"]
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
{{ include "common.containers.imageConfig" .Values.image | nindent 8 }}
|
|
env: {{ include "postgres.envVariableConfiguration" $postgres_values | nindent 10 }}
|
|
{{ $envList := list }}
|
|
{{ $secretName := (include "common.names.fullname" .) }}
|
|
{{ $envList = mustAppend $envList (dict "name" "POSTGRES_HOST" "value" (printf "%s:5432" (include "common.names.fullname" $postgres_values))) }}
|
|
{{ $envList = mustAppend $envList (dict "name" "POSTGRES_DB" "value" (include "postgres.DatabaseName" .)) }}
|
|
{{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_DATA_DIR" "value" .Values.nextcloud.datadir) }}
|
|
{{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_TRUSTED_DOMAINS" "value" .Values.nextcloud.host) }}
|
|
{{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_ADMIN_USER" "valueFromSecret" true "secretName" $secretName "secretKey" "nextcloud-username") }}
|
|
{{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_ADMIN_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "nextcloud-password") }}
|
|
{{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}
|
|
ports:
|
|
- name: http
|
|
containerPort: 80
|
|
protocol: TCP
|
|
volumeMounts:
|
|
- name: nextcloud-data
|
|
mountPath: /var/www/
|
|
subPath: "root"
|
|
- name: nextcloud-data
|
|
mountPath: /var/www/html
|
|
subPath: "html"
|
|
- name: nextcloud-data
|
|
mountPath: {{ .Values.nextcloud.datadir }}
|
|
subPath: "data"
|
|
- name: nextcloud-data
|
|
mountPath: /var/www/html/config
|
|
subPath: "config"
|
|
- name: nextcloud-data
|
|
mountPath: /var/www/html/custom_apps
|
|
subPath: "custom_apps"
|
|
- name: nextcloud-data
|
|
mountPath: /var/www/tmp
|
|
subPath: "tmp"
|
|
- name: nextcloud-data
|
|
mountPath: /var/www/html/themes
|
|
subPath: "themes"
|
|
volumes:
|
|
{{ $vols := list }}
|
|
{{ $vols = mustAppend $vols (dict "name" "nextcloud-data" "emptyDirVolumes" .Values.emptyDirVolumes "hostPathEnabled" .Values.nextcloudDataHostPathEnabled "pathField" .Values.nextcloudHostPath "datasetName" (.Values.nextcloudDataVolume | default dict).datasetName ) }}
|
|
{{ include "common.storage.volumesConfiguration" (dict "ixVolumes" .Values.ixVolumes "volumes" $vols) | nindent 8 }}
|
|
# Will mount configuration files as www-data (id: 33) for nextcloud
|
|
securityContext:
|
|
fsGroup: 33
|