diff --git a/postgresql/kustomization.yaml b/postgresql/kustomization.yaml index b64d767..3d204cb 100644 --- a/postgresql/kustomization.yaml +++ b/postgresql/kustomization.yaml @@ -9,6 +9,9 @@ resources: - vault/superuser-secret.yaml # - vault/backup-s3-secret.yaml # Disabled - using Velero instead + # StorageClass with Retain policy + - manifests/storageclass.yaml + # CNPG Cluster - manifests/cluster.yaml diff --git a/postgresql/manifests/cluster.yaml b/postgresql/manifests/cluster.yaml index ee74cd3..8157a33 100644 --- a/postgresql/manifests/cluster.yaml +++ b/postgresql/manifests/cluster.yaml @@ -10,9 +10,9 @@ spec: # Number of instances instances: 3 # 1 primary + 2 replicas for HA - # Storage configuration - using local-path + # Storage configuration - using local-path-retain for data protection storage: - storageClass: local-path + storageClass: local-path-retain size: 10Gi # Resource requests and limits diff --git a/postgresql/manifests/storageclass.yaml b/postgresql/manifests/storageclass.yaml new file mode 100644 index 0000000..ce54b46 --- /dev/null +++ b/postgresql/manifests/storageclass.yaml @@ -0,0 +1,7 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: local-path-retain +provisioner: rancher.io/local-path +reclaimPolicy: Retain +volumeBindingMode: WaitForFirstConsumer