postgres-operator
postgres-operator copied to clipboard
getting stuck when deploy postgresql cluster using "local-storage" class
I want to deploy postgresql cluster using k8s on baremetal kubernetes on multiple worker node. and when I tried to deploy postgresql cluster using storage class local-storage, I getting stuck when pvc tried to claim the pv. here is pvc output when I check it
root@d-lms-01:~/# kubectl -n stag get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pgdata-acid-stag-0 15Gi RWX Retain Available local-storage 7m43s
root@d-01:~/# kubectl -n stag get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
pgdata-acid-stag-0 Pending local-storage 8m29s
root@d-01:~/# kubectl -n stag describe pvc pgdata-acid-stag-0
Name: pgdata-acid-stag-0
Namespace: stag
StorageClass: local-storage
Status: Pending
Volume:
Labels: application=spilo
cluster-name=acid-stag
Annotations: volume.beta.kubernetes.io/storage-class: local-storage
Finalizers: [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode: Filesystem
Mounted By: acid-stag-0
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning ProvisioningFailed 2m47s (x26 over 8m52s) persistentvolume-controller storageclass.storage.k8s.io "local-storage" not found
I tried search issue in this git repo and according to this, I cannot use this storage class.
is there a way to deploy the cluster with local storage or persistent volume which working like local-storage storageClass?
turns out because I use ReadWriteMany, it should ReadWriteOnce.