mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
153 lines
5.2 KiB
YAML
153 lines
5.2 KiB
YAML
{{- if include "owncloud.host" . -}}
|
|
apiVersion: {{ template "owncloud.deployment.apiVersion" . }}
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ template "owncloud.fullname" . }}
|
|
labels:
|
|
app: {{ template "owncloud.fullname" . }}
|
|
chart: {{ template "owncloud.chart" . }}
|
|
release: "{{ .Release.Name }}"
|
|
heritage: "{{ .Release.Service }}"
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: {{ template "owncloud.fullname" . }}
|
|
release: "{{ .Release.Name }}"
|
|
replicas: 1
|
|
{{- if .Values.updateStrategy }}
|
|
strategy: {{ toYaml .Values.updateStrategy | nindent 4 }}
|
|
{{- end }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: {{ template "owncloud.fullname" . }}
|
|
chart: {{ template "owncloud.chart" . }}
|
|
release: "{{ .Release.Name }}"
|
|
{{- if or .Values.podAnnotations .Values.metrics.enabled }}
|
|
annotations:
|
|
{{- if .Values.podAnnotations }}
|
|
{{ toYaml .Values.podAnnotations | indent 8 }}
|
|
{{- end }}
|
|
{{- if .Values.metrics.podAnnotations }}
|
|
{{ toYaml .Values.metrics.podAnnotations | indent 8 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
spec:
|
|
{{- include "owncloud.imagePullSecrets" . | indent 6 }}
|
|
hostAliases:
|
|
- ip: "127.0.0.1"
|
|
hostnames:
|
|
- "status.localhost"
|
|
containers:
|
|
- name: {{ template "owncloud.fullname" . }}
|
|
image: {{ template "owncloud.image" . }}
|
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
|
env:
|
|
- name: ALLOW_EMPTY_PASSWORD
|
|
value: {{ .Values.allowEmptyPassword | quote }}
|
|
{{- if .Values.mariadb.enabled }}
|
|
- name: MARIADB_HOST
|
|
value: {{ template "owncloud.mariadb.fullname" . }}
|
|
- name: MARIADB_PORT_NUMBER
|
|
value: "3306"
|
|
- name: OWNCLOUD_DATABASE_NAME
|
|
value: {{ .Values.mariadb.db.name | quote }}
|
|
- name: OWNCLOUD_DATABASE_USER
|
|
value: {{ .Values.mariadb.db.user | quote }}
|
|
- name: OWNCLOUD_DATABASE_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ template "owncloud.mariadb.fullname" . }}
|
|
key: mariadb-password
|
|
{{- else }}
|
|
- name: MARIADB_HOST
|
|
value: {{ .Values.externalDatabase.host | quote }}
|
|
- name: MARIADB_PORT_NUMBER
|
|
value: {{ .Values.externalDatabase.port | quote }}
|
|
- name: OWNCLOUD_DATABASE_NAME
|
|
value: {{ .Values.externalDatabase.database | quote }}
|
|
- name: OWNCLOUD_DATABASE_USER
|
|
value: {{ .Values.externalDatabase.user | quote }}
|
|
- name: OWNCLOUD_DATABASE_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ printf "%s-%s" .Release.Name "externaldb" }}
|
|
key: db-password
|
|
{{- end }}
|
|
{{- $port:=.Values.service.port | toString }}
|
|
- name: OWNCLOUD_HOST
|
|
value: "{{ include "owncloud.host" . }}{{- if ne $port "80" }}:{{ .Values.service.port }}{{ end }}"
|
|
- name: OWNCLOUD_USERNAME
|
|
value: {{ default "" .Values.owncloudUsername | quote }}
|
|
- name: OWNCLOUD_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ template "owncloud.fullname" . }}
|
|
key: owncloud-password
|
|
- name: OWNCLOUD_EMAIL
|
|
value: {{ default "" .Values.owncloudEmail | quote }}
|
|
ports:
|
|
- name: http
|
|
containerPort: 80
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /status.php
|
|
port: http
|
|
httpHeaders:
|
|
- name: Host
|
|
value: {{ include "owncloud.host" . | quote }}
|
|
initialDelaySeconds: 120
|
|
timeoutSeconds: 5
|
|
failureThreshold: 6
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /status.php
|
|
port: http
|
|
httpHeaders:
|
|
- name: Host
|
|
value: {{ include "owncloud.host" . | quote }}
|
|
initialDelaySeconds: 30
|
|
timeoutSeconds: 3
|
|
periodSeconds: 5
|
|
resources:
|
|
{{ toYaml .Values.resources | indent 10 }}
|
|
volumeMounts:
|
|
- name: owncloud-data
|
|
mountPath: /bitnami/owncloud
|
|
{{- if .Values.metrics.enabled }}
|
|
- name: metrics
|
|
image: {{ template "owncloud.metrics.image" . }}
|
|
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
|
|
command: [ '/bin/apache_exporter', '-scrape_uri', 'http://status.localhost:80/server-status/?auto']
|
|
ports:
|
|
- name: metrics
|
|
containerPort: 9117
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /metrics
|
|
port: metrics
|
|
initialDelaySeconds: 15
|
|
timeoutSeconds: 5
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /metrics
|
|
port: metrics
|
|
initialDelaySeconds: 5
|
|
timeoutSeconds: 1
|
|
resources:
|
|
{{ toYaml .Values.metrics.resources | indent 10 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: owncloud-data
|
|
{{- if .Values.persistence.enabled }}
|
|
persistentVolumeClaim:
|
|
claimName: {{ if .Values.persistence.owncloud.existingClaim }}{{ .Values.persistence.owncloud.existingClaim }}{{- else }}{{ template "owncloud.fullname" . }}-owncloud{{- end }}
|
|
{{- else }}
|
|
emptyDir: {}
|
|
{{- end }}
|
|
{{- with .Values.affinity }}
|
|
affinity:
|
|
{{ toYaml . | indent 8 }}
|
|
{{- end }}
|
|
{{- end -}}
|