PersistentVolumeClaims in a pending state

147 Views Asked by At

After deploying a Keycloak Helm chart on my cluster, I encountered an issue where the pods intermittently showed a status of CrashLoopBackOff and were not consistently ready (0/1). To investigate further, I observed that the Postgresql pods were stuck in a pending state, which prevented the Keycloak pods from running as they rely on the availability of the Postgresql pods.

NAME                        READY   STATUS             RESTARTS          AGE
keycloak-0                  0/1     CrashLoopBackOff   472 (2m30s ago)   2d11h
keycloak-lab-0              0/1     Init:0/1           0                 27m
keycloak-lab-postgresql-0   0/1     Pending            0                 27m

While trying to inspect further, I realized that I have no available Storage Class for PVC.

For dynamic volume provisioning, I followed the guide [0] to create a manifest file for Storage Class and after that, I created Persistent Volume Claims.

https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/ [0]

storageclass.yaml

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: standard
provisioner: kubernetes.io/nfs
parameters:
  type: pd-ssd
reclaimPolicy: Retain
allowVolumeExpansion: true
mountOptions:
  - debug
volumeBindingMode: Immediate

persistentvolumeclaims.yaml


apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: claim1
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: standard
  resources:
    requests:
      storage: 60Gi

Still, the persistent volume claim (claim1) I created keeps on in a pending state.

kube-user@dev-m01:~$ kubectl get pvc -n keycloak
NAME                                 STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
claim1                               Pending                                      standard       18m
data-keycloak-lab-postgresql-0       Pending                                      standard       172m
data-keycloak-postgresql-0           Pending                                      standard       2d12h
data-ovh-keycloak-lab-postgresql-0   Pending                                      standard       3d17h

I used the describe command to inspect further and received the following output.

kube-user@dev-m01:~$ kubectl describe pvc claim1 -n keycloak
Name:          claim1
Namespace:     keycloak
StorageClass:  standard
Status:        Pending
Volume:
Labels:        <none>
Annotations:   <none>
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode:    Filesystem
Used By:       <none>
Events:
  Type     Reason              Age                   From                         Message
  ----     ------              ----                  ----                         -------
  **Warning  ProvisioningFailed  3m21s (x62 over 18m)  persistentvolume-controller  no provisional volume plugin matched**

Please, Am I missing something very basic here? and are there any suggestions on how I can resolve this?

0

There are 0 best solutions below