Tag Archives: persistentvolumecontroller waiting for a volume to be created

K8s version 1.20x nfs dynamic storage error: persistentvolume-controller waiting for a volume to be created, either by external provisioner “qgg-nfs-storage” or manually created by system administrator

View error reports

[root@k8s-matser01 nfs.rbac]# kubectl get pvc
NAME         STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS          AGE
test-claim   Pending                                      managed-nfs-storage   5s
[root@k8s-matser01 nfs.rbac]# kubectl describe pvc test-claim 
Name:          test-claim
Namespace:     default
StorageClass:  managed-nfs-storage
Status:        Pending
Volume:        
Labels:        <none>
Annotations:   volume.beta.kubernetes.io/storage-class: managed-nfs-storage
               volume.beta.kubernetes.io/storage-provisioner: qgg-nfs-storage
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
Used By:       <none>
Events:
  Type    Reason                Age               From                         Message
  ----    ------                ----              ----                         -------
  Normal  ExternalProvisioning  8s (x2 over 13s)  persistentvolume-controller  waiting for a volume to be created, either by external provisioner "qgg-nfs-storage" or manually created by system administrator

3. Modify the apiserver configuration

[root@k8s-matser01 nfs.rbac]# cat /etc/kubernetes/manifests/kube-apiserver.yaml
apiVersion: v1
ยทยทยท
    - --tls-private-key-file=/etc/kubernetes/pki/apiserver.key
    - --feature-gates=RemoveSelfLink=false # Add this configuration

3. View

### restart apiserver
[root@k8s-matser01 nfs.rbac]# kubectl get pvc
NAME         STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS          AGE
test-claim   Bound    pvc-ba0152df-98e4-41fd-b0aa-b79b7aa8419b   1Mi        RWX            managed-nfs-storage   3m11s