support persistent volumes for postgres and the keep store
authorMike Ludwig <mludwig@mitre.org>
Thu, 26 Nov 2020 00:06:41 +0000 (19:06 -0500)
committerMike Ludwig <mludwig@mitre.org>
Thu, 26 Nov 2020 00:06:41 +0000 (19:06 -0500)
Arvados-DCO-1.1-Signed-off-by: Michael Ludwig <michael.david.ludwig@gmail.com>

charts/arvados/templates/keep-store-deployment.yaml
charts/arvados/templates/postgres-deployment.yaml
charts/arvados/templates/postgres-pvc.yaml [new file with mode: 0644]
charts/arvados/values.yaml

index 128bba966799f31b8e71990fd5b8264f0961c0bb..f7fa8d1d9a3255c98f51bf3bc52c445635c0ff4e 100644 (file)
@@ -38,8 +38,23 @@ spec:
             - name: etc-configmap
               mountPath: /etc/arvados/config.yml
               subPath: config.yml
+            {{- if .Values.keep.persistence.enabled }}
+            - name: keep-store-storage
+              mountPath: /keepdata
+            {{- end }}
       volumes:
         - name: etc-configmap
           configMap:
             name: etc-configmap
-
+  {{- if .Values.keep.persistence.enabled }}
+  volumeClaimTemplates:
+    - metadata:
+        name: keep-store-storage
+      spec:
+        storageClassName: {{ .Values.keep.persistence.storageClass }}
+        accessModes:
+          - ReadWriteOnce
+        resources:
+          requests:
+            storage: {{ .Values.keep.persistence.size }}
+  {{- end }}
index 786edc367092453e228266a9625e11b5af805d82..8462bb6d5e44ded48c3026bf0b589e1ca02e9e4e 100644 (file)
@@ -27,13 +27,22 @@ spec:
           image: "postgres:9.5"
           imagePullPolicy: {{ .Values.image.pullPolicy }}
           env:
-          - name: POSTGRES_HOST_AUTH_METHOD
-            value: "trust"
+            - 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 }}
diff --git a/charts/arvados/templates/postgres-pvc.yaml b/charts/arvados/templates/postgres-pvc.yaml
new file mode 100644 (file)
index 0000000..85bcbc2
--- /dev/null
@@ -0,0 +1,22 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+{{- if .Values.postgres.persistence.enabled }}
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  name: {{ .Release.Name }}-postgres-pvc
+  labels:
+    app: {{ template "arvados.name" . }}
+    chart: {{ template "arvados.chart" . }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+spec:
+  storageClassName: {{ .Values.postgres.persistence.storageClass }}
+  accessModes:
+    - ReadWriteOnce
+  resources:
+    requests:
+      storage: {{ .Values.postgres.persistence.size }}
+{{- end }}
\ No newline at end of file
index b84eb8ecb677c45a342427e7b182c9fee33dc044..2fd94a306e587d678c3922df36725156674368e3 100644 (file)
@@ -77,6 +77,18 @@ arvados:
       arvadosCLI: 2.1.0
       arvadosLoginSync: 2.1.0
 
+postgres:
+  persistence:
+    enabled: true
+    storageClass: ~
+    size: 8Gi
+
+keep:
+  persistence:
+    enabled: true
+    storageClass: ~
+    size: 64Gi
+
 # A custom bundle of CA certificates to use.
 # Useful for corporate networks with TLS proxies.
 # Set it by using the --set-file Helm argument.