support persistent volumes for postgres and the keep store
[arvados-k8s.git] / charts / arvados / templates / postgres-deployment.yaml
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 apiVersion: apps/v1
6 kind: Deployment
7 metadata:
8   name: "arvados-postgres"
9   labels:
10     app: arvados-postgres
11     chart: {{ template "arvados.chart" . }}
12     release: {{ .Release.Name }}
13     heritage: {{ .Release.Service }}
14 spec:
15   selector:
16     matchLabels:
17       app: arvados-postgres
18       release: {{ .Release.Name }}
19   template:
20     metadata:
21       labels:
22         app: arvados-postgres
23         release: {{ .Release.Name }}
24     spec:
25       containers:
26         - name: {{ .Chart.Name }}
27           image: "postgres:9.5"
28           imagePullPolicy: {{ .Values.image.pullPolicy }}
29           env:
30             - name: POSTGRES_HOST_AUTH_METHOD
31               value: "trust"
32           volumeMounts:
33             - name: postgres-configmap
34               mountPath: /docker-entrypoint-initdb.d/create_dbs.sh
35               subPath: create_dbs.sh
36             {{- if .Values.postgres.persistence.enabled }}
37             - name: postgres-storage
38               mountPath: /var/lib/postgresql/data
39             {{- end }}
40       volumes:
41         - name: postgres-configmap
42           configMap:
43             name: postgres-configmap
44         {{- if .Values.postgres.persistence.enabled }}
45         - name: postgres-storage
46           persistentVolumeClaim:
47             claimName: {{ .Release.Name }}-postgres-pvc
48         {{- end }}