TrueChartsClone/test/nextcloud/2.3.2/templates/postgres-deployment.yaml

52 lines
1.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "nextcloud.fullname" . }}-postgres
labels:
helm.sh/chart: {{ include "nextcloud.chart" . }}
{{- include "nextcloud.postgres.selectorLabels" . | nindent 4 }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: database
spec:
replicas: 1
strategy:
type: {{ .Values.nextcloud.strategy }}
selector:
matchLabels:
{{- include "nextcloud.postgres.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: database
template:
metadata:
labels:
{{- include "nextcloud.postgres.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: database
annotations:
rollme: {{ randAlphaNum 5 | quote }}
spec:
containers:
- name: {{ .Chart.Name }}-postgres
image: "postgres:13.1"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: db-details
key: db-password
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
- name: postgres-backup
mountPath: /postgres_backups
ports:
- name: postgres-tcp
containerPort: 5432
protocol: TCP
volumes:
- name: postgres-data
hostPath:
path: {{ template "configuredPostgresHostPath" . }}
- name: postgres-backup
hostPath:
path: {{ template "configuredBackupPostgresHostPath" . }}