mirror of
https://github.com/truenas/charts.git
synced 2026-05-12 03:26:08 +08:00
114 lines
3.7 KiB
YAML
114 lines
3.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ template "nextcloud.fullname" . }}
|
|
labels:
|
|
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
|
|
helm.sh/chart: {{ include "nextcloud.chart" . }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
app.kubernetes.io/component: app
|
|
{{- if .Values.deploymentAnnotations }}
|
|
annotations:
|
|
{{ toYaml .Values.deploymentAnnotations | indent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: {{ .Values.nextcloud.strategy }}
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
app.kubernetes.io/component: app
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
app.kubernetes.io/component: app
|
|
annotations:
|
|
rollme: {{ randAlphaNum 5 | quote }}
|
|
spec:
|
|
{{- if .Values.image.pullSecrets }}
|
|
imagePullSecrets:
|
|
{{- range .Values.image.pullSecrets }}
|
|
- name: {{ . }}
|
|
{{- end}}
|
|
{{- end }}
|
|
initContainers:
|
|
- name: init-postgresdb
|
|
image: busybox:latest
|
|
command: ['sh', '-c', "until nslookup {{ template "nextcloud.fullname" . }}-postgres; do echo waiting for postgres; sleep 2; done"]
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
env:
|
|
- name: POSTGRES_HOST
|
|
value: {{ template "nextcloud.fullname" . }}-postgres:5432
|
|
- name: POSTGRES_DB
|
|
value: "nextcloud"
|
|
- name: POSTGRES_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: db-details
|
|
key: db-user
|
|
- name: POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: db-details
|
|
key: db-password
|
|
- name: NEXTCLOUD_ADMIN_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ template "nextcloud.fullname" . }}
|
|
key: nextcloud-username
|
|
- name: NEXTCLOUD_ADMIN_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ template "nextcloud.fullname" . }}
|
|
key: nextcloud-password
|
|
- name: NEXTCLOUD_TRUSTED_DOMAINS
|
|
value: {{ .Values.nextcloud.host }}
|
|
- name: NEXTCLOUD_DATA_DIR
|
|
value: {{ .Values.nextcloud.datadir | quote }}
|
|
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:
|
|
- name: nextcloud-data
|
|
{{- if ne (include "configuredHostPath" .) "" }}
|
|
hostPath:
|
|
path: {{ template "configuredHostPath" . }}
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|
|
# Will mount configuration files as www-data (id: 33) for nextcloud
|
|
securityContext:
|
|
fsGroup: 33
|