Files
deprecated-helm-charts/stable/nextcloud/templates/deployment.yaml
T
Havrileck Alexandre 9f1db2d47d [stable/nextcloud] Add flexibility and more configurations (#16205)
* [stable/nextcloud] Allow to inject custom php configuration files

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Add annotations and labels on PVC

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Add fs group of www-data for mounted files

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Change mount path of PVC

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Add tmp directory in volume

This directory can be used for uploads as temporary directory

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Fix cronjob job template labels for new helm spec

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Allow change of cronjob image and add pull secrets

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Allow change cronjob resources,tolerations,affinity

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Cronjob (curl) follow redirect

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Add default values for persistence annotations

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Add all default nextcloud configurations

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Update documentation with new values and indent

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Upgrade chart version

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Fix trailing spaces in default values

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Fix default values for cronjob image declaration

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Fix default configs not mounted

Signed-off-by: Alexandre Havrileck <alexandre.havrileck@easymile.com>

* [stable/nextcloud] Mount default configs only if extra configs exists

Signed-off-by: Havrileck Alexandre <havrileckalexandre@gmail.com>
2019-08-10 03:53:13 -07:00

249 lines
8.9 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 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.redis.enabled }}
{{ template "nextcloud.redis.fullname" . }}-client: "true"
{{- end }}
spec:
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
{{- range .Values.image.pullSecrets }}
- name: {{ . }}
{{- end}}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- if .Values.internalDatabase.enabled }}
- name: SQLITE_DATABASE
value: {{ .Values.internalDatabase.name | quote }}
{{- else if .Values.mariadb.enabled }}
- name: MYSQL_HOST
value: {{ template "nextcloud.mariadb.fullname" . }}
- name: MYSQL_DATABASE
value: {{ .Values.mariadb.db.name | quote }}
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: {{ printf "%s-%s" .Release.Name "db" }}
key: db-username
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: {{ printf "%s-%s" .Release.Name "db" }}
key: db-password
{{- else }}
{{- if eq .Values.externalDatabase.type "postgresql" }}
- name: POSTGRES_HOST
value: {{ .Values.externalDatabase.host | quote }}
- name: POSTGRES_DB
value: {{ .Values.externalDatabase.database | quote }}
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: {{ printf "%s-%s" .Release.Name "db" }}
key: db-username
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ printf "%s-%s" .Release.Name "db" }}
key: db-password
{{- else }}
- name: MYSQL_HOST
value: {{ .Values.externalDatabase.host | quote }}
- name: MYSQL_DATABASE
value: {{ .Values.externalDatabase.database | quote }}
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: {{ printf "%s-%s" .Release.Name "db" }}
key: db-username
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: {{ printf "%s-%s" .Release.Name "db" }}
key: db-password
{{- end }}
{{- end }}
- 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 }}
{{- if ne (int .Values.nextcloud.update) 0 }}
- name: NEXTCLOUD_UPDATE
value: {{ .Values.nextcloud.update | quote }}
{{- end }}
- name: NEXTCLOUD_DATA_DIR
value: {{ .Values.nextcloud.datadir | quote }}
{{- if .Values.nextcloud.tableprefix }}
- name: NEXTCLOUD_TABLE_PREFIX
value: {{ .Values.nextcloud.tableprefix | quote }}
{{- end }}
{{- if .Values.nextcloud.mail.enabled }}
- name: MAIL_FROM_ADDRESS
value: {{ .Values.nextcloud.mail.fromAddress | quote }}
- name: MAIL_DOMAIN
value: {{ .Values.nextcloud.mail.domain | quote }}
- name: SMTP_HOST
value: {{ .Values.nextcloud.mail.smtp.host | quote }}
- name: SMTP_SECURE
value: {{ .Values.nextcloud.mail.smtp.secure | quote }}
- name: SMTP_PORT
value: {{ .Values.nextcloud.mail.smtp.port | quote }}
- name: SMTP_AUTHTYPE
value: {{ .Values.nextcloud.mail.smtp.authtype | quote }}
- name: SMTP_NAME
valueFrom:
secretKeyRef:
name: {{ template "nextcloud.fullname" . }}
key: smtp-username
- name: SMTP_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "nextcloud.fullname" . }}
key: smtp-password
{{- end }}
{{- if .Values.redis.enabled }}
- name: REDIS_HOST
value: {{ template "nextcloud.redis.fullname" . }}-master
- name: REDIS_HOST_PORT
value: {{ .Values.redis.redisPort | quote }}
{{- end }}
ports:
- name: http
containerPort: 80
protocol: TCP
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /status.php
port: http
httpHeaders:
- name: Host
value: {{ .Values.nextcloud.host | quote }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /status.php
port: http
httpHeaders:
- name: Host
value: {{ .Values.nextcloud.host | quote }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 10 }}
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
{{- range $key, $value := .Values.nextcloud.configs }}
- name: nextcloud-config
mountPath: /var/www/html/config/{{ $key }}
subPath: {{ $key }}
{{- end }}
{{- if .Values.nextcloud.configs }}
{{- range $key, $value := .Values.nextcloud.defaultConfigs }}
{{- if $value }}
- name: nextcloud-config
mountPath: /var/www/html/config/{{ $key }}
subPath: {{ $key }}
{{- end }}
{{- end }}
{{- end }}
{{- range $key, $value := .Values.nextcloud.phpConfigs }}
- name: nextcloud-phpconfig
mountPath: /usr/local/etc/php/conf.d/{{ $key }}
subPath: {{ $key }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: nextcloud-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- if .Values.nextcloud.configs }}
- name: nextcloud-config
configMap:
name: {{ template "nextcloud.fullname" . }}-config
{{- end }}
{{- if .Values.nextcloud.phpConfigs }}
- name: nextcloud-phpconfig
configMap:
name: {{ template "nextcloud.fullname" . }}-phpconfig
{{- end }}
# Will mount configuration files as www-data (id: 33) for nextcloud
securityContext:
fsGroup: 33