apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "owncloud.fullname" . }} labels: {{- include "owncloud.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} selector: matchLabels: {{- include "owncloud.selectorLabels" . | nindent 6 }} template: metadata: labels: {{- include "owncloud.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.containerSecurityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: - name: TZ value: {{ .Values.env.TZ | quote }} - name: OWNCLOUD_DOMAIN value: {{ .Values.env.OWNCLOUD_DOMAIN | quote }} - name: OWNCLOUD_TRUSTED_DOMAINS value: {{ .Values.env.OWNCLOUD_TRUSTED_DOMAINS | quote }} - name: OWNCLOUD_DB_TYPE value: {{ .Values.database.type | quote }} {{- if .Values.database.external.enabled }} - name: OWNCLOUD_DB_HOST value: {{ .Values.database.external.host | quote }} - name: OWNCLOUD_DB_PORT value: {{ .Values.database.external.port | quote }} - name: OWNCLOUD_DB_NAME value: {{ .Values.database.external.database | quote }} - name: OWNCLOUD_DB_USERNAME value: {{ .Values.database.external.username | quote }} - name: OWNCLOUD_DB_PASSWORD valueFrom: secretKeyRef: name: {{ .Values.database.external.existingSecret }} key: {{ .Values.database.external.existingSecretKey }} {{- end }} - name: OWNCLOUD_ADMIN_USERNAME value: {{ .Values.admin.username | quote }} - name: OWNCLOUD_ADMIN_PASSWORD valueFrom: secretKeyRef: name: {{ .Values.admin.existingSecret }} key: {{ .Values.admin.existingSecretKey }} - name: OWNCLOUD_REDIS_ENABLED value: {{ .Values.env.OWNCLOUD_REDIS_ENABLED | quote }} - name: PHP_MEMORY_LIMIT value: {{ .Values.env.PHP_MEMORY_LIMIT | quote }} - name: PHP_UPLOAD_LIMIT value: {{ .Values.env.PHP_UPLOAD_LIMIT | quote }} ports: - name: http containerPort: {{ .Values.service.port }} protocol: TCP volumeMounts: - name: config mountPath: {{ .Values.persistence.config.mountPath }} - name: files mountPath: {{ .Values.persistence.files.mountPath }} livenessProbe: httpGet: path: /status.php port: http initialDelaySeconds: 30 periodSeconds: 10 readinessProbe: httpGet: path: /status.php port: http initialDelaySeconds: 30 periodSeconds: 10 resources: {{- toYaml .Values.resources | nindent 12 }} volumes: - name: config {{- if .Values.persistence.config.enabled }} persistentVolumeClaim: {{- if .Values.persistence.config.existingClaim }} claimName: {{ .Values.persistence.config.existingClaim }} {{- else }} claimName: {{ include "owncloud.fullname" . }}-config {{- end }} {{- else }} emptyDir: {} {{- end }} - name: files {{- if .Values.persistence.files.enabled }} persistentVolumeClaim: {{- if .Values.persistence.files.existingClaim }} claimName: {{ .Values.persistence.files.existingClaim }} {{- else }} claimName: {{ include "owncloud.fullname" . }}-files {{- end }} {{- else }} emptyDir: {} {{- 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 }}