Local persistent store for Postgres

Change-Id: I6af6402a5826300352cf24e268dd043771541446
diff --git a/xos-core/templates/db-deployment.yaml b/xos-core/templates/db-deployment.yaml
index d508962..82f1507 100644
--- a/xos-core/templates/db-deployment.yaml
+++ b/xos-core/templates/db-deployment.yaml
@@ -43,3 +43,12 @@
                 secretKeyRef:
                   name: xos-db-secrets
                   key: password
+      {{- if .Values.needDBPersistence }}
+          volumeMounts:
+            - name: db-pv-storage
+              mountPath: "/var/lib/postgresql/data"
+      volumes:
+        - name: db-pv-storage
+          persistentVolumeClaim:
+            claimName: {{ .Values.dbPvClaimName }}
+      {{- end }}
diff --git a/xos-core/values.yaml b/xos-core/values.yaml
index a2fc5ff..6cb8a46 100644
--- a/xos-core/values.yaml
+++ b/xos-core/values.yaml
@@ -18,6 +18,10 @@
 
 imagePullPolicy: 'Always'
 
+dbPvClaimName: db-pv-claim
+
+needDBPersistence: false
+
 # Docker images
 # YAML variable names can't contain `-`, so substituted with `_`
 xos_coreImage: 'xosproject/xos-core:master'