support persistent volumes for postgres and the keep store
[arvados-k8s.git] / charts / arvados / templates / postgres-deployment.yaml
index 183137253086765db8d84a4509a234d4b2ff74a9..8462bb6d5e44ded48c3026bf0b589e1ca02e9e4e 100644 (file)
@@ -26,11 +26,23 @@ spec:
         - name: {{ .Chart.Name }}
           image: "postgres:9.5"
           imagePullPolicy: {{ .Values.image.pullPolicy }}
+          env:
+            - name: POSTGRES_HOST_AUTH_METHOD
+              value: "trust"
           volumeMounts:
             - name: postgres-configmap
               mountPath: /docker-entrypoint-initdb.d/create_dbs.sh
               subPath: create_dbs.sh
+            {{- if .Values.postgres.persistence.enabled }}
+            - name: postgres-storage
+              mountPath: /var/lib/postgresql/data
+            {{- end }}
       volumes:
         - name: postgres-configmap
           configMap:
             name: postgres-configmap
+        {{- if .Values.postgres.persistence.enabled }}
+        - name: postgres-storage
+          persistentVolumeClaim:
+            claimName: {{ .Release.Name }}-postgres-pvc
+        {{- end }}