<p>I am trying to set up Postgres cluster using CrunchyData Postgres operator. I am facing issue where the pod <code>backrest-shared-repo</code> is always in <code>Pending</code> state.</p>
<pre><code>NAME                      STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
postgres-ha-1             Pending                                                     12m
postgres-ha-1-pgbr-repo   Pending                                                     12m
</code></pre>
<p>While debugging I found that the <code>PersistentVolumeClaim</code> is also in pending state. Events of <code>PVC</code> is below:</p>
<pre><code>no persistent volumes available for this claim and no storage class is set
</code></pre>
<p><strong>PVC.yaml</strong></p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  creationTimestamp: &quot;2022-07-08T10:28:48Z&quot;
  finalizers:
  - kubernetes.io/pvc-protection
  labels:
    pg-cluster: postgres-ha-1
    vendor: crunchydata
  name: postgres-ha-1-pgbr-repo
  namespace: pgo
  resourceVersion: &quot;1786569&quot;
  uid: 6f80d516-320c-490e-ad6a-83400ea998a4
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 3G
  volumeMode: Filesystem
status:
  phase: Pending
</code></pre>
<p>Below is the storage configuration in <code>postgres-operator.yml</code>:</p>
<pre><code>backrest_storage: &quot;hostpathstorage&quot;
backup_storage: &quot;hostpathstorage&quot;
primary_storage: &quot;hostpathstorage&quot;
replica_storage: &quot;hostpathstorage&quot;
pgadmin_storage: &quot;hostpathstorage&quot;
wal_storage: &quot;&quot;
storage1_name: &quot;default&quot;
storage1_access_mode: &quot;ReadWriteOnce&quot;
storage1_size: &quot;1G&quot;
storage1_type: &quot;dynamic&quot;
storage2_name: &quot;hostpathstorage&quot;
storage2_access_mode: &quot;ReadWriteMany&quot;
storage2_size: &quot;3G&quot;
storage2_type: &quot;create&quot;
storage3_name: &quot;nfsstorage&quot;
storage3_access_mode: &quot;ReadWriteMany&quot;
storage3_size: &quot;1G&quot;
storage3_type: &quot;create&quot;
storage3_supplemental_groups: &quot;65534&quot;
storage4_name: &quot;nfsstoragered&quot;
storage4_access_mode: &quot;ReadWriteMany&quot;
storage4_size: &quot;1G&quot;
storage4_match_labels: &quot;crunchyzone=red&quot;
storage4_type: &quot;create&quot;
storage4_supplemental_groups: &quot;65534&quot;
storage5_name: &quot;storageos&quot;
storage5_access_mode: &quot;ReadWriteOnce&quot;
storage5_size: &quot;5Gi&quot;
storage5_type: &quot;dynamic&quot;
storage5_class: &quot;fast&quot;
storage6_name: &quot;primarysite&quot;
storage6_access_mode: &quot;ReadWriteOnce&quot;
storage6_size: &quot;4G&quot;
storage6_type: &quot;dynamic&quot;
storage6_class: &quot;primarysite&quot;
storage7_name: &quot;alternatesite&quot;
storage7_access_mode: &quot;ReadWriteOnce&quot;
storage7_size: &quot;4G&quot;
storage7_type: &quot;dynamic&quot;
storage7_class: &quot;alternatesite&quot;
storage8_name: &quot;gce&quot;
storage8_access_mode: &quot;ReadWriteOnce&quot;
storage8_size: &quot;300M&quot;
storage8_type: &quot;dynamic&quot;
storage8_class: &quot;standard&quot;
storage9_name: &quot;rook&quot;
storage9_access_mode: &quot;ReadWriteOnce&quot;
storage9_size: &quot;1Gi&quot;
storage9_type: &quot;dynamic&quot;
storage9_class: &quot;rook-ceph-block&quot;
</code></pre>
<p>Can anyone help me in solving the issue?</p>

<p>You need to create a <code>PersistentVolume</code> in the cluster before you can use it with a <code>PersistentVolumeClaim</code>. The error simply means you do not have any PVs that can be matched with your PVC.</p>
<p>Here's the official <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/" rel="nofollow noreferrer">guide</a> on how to create <code>PersistentVolumes</code>. Just ensure that the specifications you set on the <code>PersistentVolume</code> match the <code>PersistentVolumeClaim</code>, otherwise it will not be bound.</p>
<p>You can use an <code>hostPath</code> type PV which will simply create a directory on your worker node and use it to store data. This will prove the functional correctness. Later perhaps you can move towards a more central solution of having a centralized Volume store (details in the docs <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/" rel="nofollow noreferrer">here</a>).</p>
