From e2ed449bef7a790dd0dd3871d4345fd8313624ae Mon Sep 17 00:00:00 2001
From: Robert Marklund <robbelibobban@gmail.com>
Date: Fri, 2 Dec 2022 16:53:24 +0100
Subject: [PATCH] helm: add storage class to instance and backup

Signed-off-by: Robert Marklund <robbelibobban@gmail.com>
---
 helm/postgres/templates/postgres.yaml | 2 ++
 helm/postgres/values.yaml             | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/helm/postgres/templates/postgres.yaml b/helm/postgres/templates/postgres.yaml
index bb46885d..94b5dc47 100644
--- a/helm/postgres/templates/postgres.yaml
+++ b/helm/postgres/templates/postgres.yaml
@@ -21,6 +21,7 @@ spec:
     - name: {{ default "instance1" .Values.instanceName | quote }}
       replicas: {{ default 1 .Values.instanceReplicas }}
       dataVolumeClaimSpec:
+        storageClassName: {{ default "standard" .Values.instanceStorageClassName | quote }}
         accessModes:
         - "ReadWriteOnce"
         resources:
@@ -56,6 +57,7 @@ spec:
         {{- if $repo.volume }}
         volume:
           volumeClaimSpec:
+            storageClassName: {{ default "standard" $repo.volume.backupStorageClassName | quote }}
             accessModes:
             - "ReadWriteOnce"
             resources:
diff --git a/helm/postgres/values.yaml b/helm/postgres/values.yaml
index 18beb250..c05e8dca 100644
--- a/helm/postgres/values.yaml
+++ b/helm/postgres/values.yaml
@@ -182,7 +182,7 @@ postgresVersion: 14
 #   region: ""
 #   # key is the S3 key. This is stored in a Secret.
 #   key: ""
-#   # keySecret is the S3 key secret. This is tored in a Secret.
+#   # keySecret is the S3 key secret. This is stored in a Secret.
 #   keySecret: ""
 #   # encryptionPassphrase is an optional parameter to enable encrypted backups
 #   # with pgBackRest. This is encrypted by pgBackRest and does not use S3's