title: PostgreSQL-HA on Kubernetes recover from Volume Snapshot?
body: <p>I have a Kubernetes Volume Snapshot created for pgsql-ha persistent volume backup.</p>
  <p>Now that I'm able to recover the PVC by specifying the <em>dataSource</em> as the volume snapshot, and trying to create a new pgsql-ha cluster using HELM chart, then attach this PCV to recover the data. Following is the example installation command:</p>
  <pre><code>helm install db-ha bitnami/postgresql-ha\
      --set postgresql.password=$PWD \
      --set persistence.existingClaim=&quot;pvc-restore-from-snapshot&quot;
  </code></pre>
  <p>Then the <em>pgpol</em> and both <em>postgresql</em> Pods shows CrashLoopBackOff forever.</p>
  <pre><code>$ kubectl get pods --watch
  NAME                           READY   STATUS             RESTARTS   AGE
  db-ha-pgpool-gradfergr43sfxv   0/1     Running            0          8s
  db-ha-postgresql-0             0/1     Init:0/1           0          8s
  db-ha-postgresql-1             0/1     Init:0/1           0          8s
  db-ha-postgresql-1             0/1     PodInitializing    0          23s
  db-ha-postgresql-0             0/1     PodInitializing    0          23s
  db-ha-postgresql-1             0/1     Error              0          24s
  db-ha-postgresql-0             0/1     Error              0          24s
  db-ha-postgresql-1             0/1     Error              1          25s
  db-ha-postgresql-0             0/1     Error              1          25s
  db-ha-postgresql-1             0/1     CrashLoopBackOff   1          26s
  db-ha-postgresql-0             0/1     CrashLoopBackOff   1          27s
  </code></pre>
  <p>From what I have read so far in <strong><a href="https://github.com/bitnami/charts/issues/4623" rel="nofollow noreferrer">this issue</a></strong>, <em>persistence.existingClaim</em> is only supported when <em>replica</em> was set to 1, which means it can only be restored on a non-ha cluster, and pgsql-ha is currently unable to replicate the manually specified PVC.</p>
  <p>So I'm wondering the following:</p>
  <ul>
  <li>If that is the whole story, and there is nothing that I'm missing</li>
  <li>If it's possible to modify the <em>storageClass</em> or even the <em>provisioner</em> (ebs-csi), so that the existing PVC can be used</li>
  <li>If other workaround exist for this workflow</li>
  </ul>
  <p>Many thanks!</p>