NFS Persistent Volume Claim remains pending indefinitely

11/29/2018

I get the following error when creating a PVC and I have no idea what it means.

Events:
  Type    Reason             Age              From           Message
  ----    ------             ----             ----           -------
  Normal  ExternalExpanding  1m (x3 over 5m)  volume_expand  Ignoring the PVC: didn't find a plugin capable of expanding the volume; waiting for an external
controller to process this PVC.

My PV for it is there and seems to be fine.

Here is the spec for my PV and PVC.

apiVersion: v1
kind: PersistentVolume
metadata:
  creationTimestamp: null
  finalizers:
  - kubernetes.io/pv-protection
  labels:
    app: projects-service
    app-guid: design-center-projects-service
    asset: service
    chart: design-center-projects-service
    class: projects-service-nfs
    company: mulesoft
    component: projects
    component-asset: projects-service
    heritage: Tiller
    product: design-center
    product-component: design-center-projects
    release: design-center-projects-service
  name: projects-service-nfs
  selfLink: /api/v1/persistentvolumes/projects-service-nfs
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 30Gi
  claimRef:
    apiVersion: v1
    kind: PersistentVolumeClaim
    name: projects-service-nfs-block
    namespace: design-center
    resourceVersion: "7932052"
    uid: d114dd38-f411-11e8-b7b1-1230f683f84a
  mountOptions:
  - nfsvers=3
  - hard
  - sync
  nfs:
    path: /
    server: 1.1.1.1
  persistentVolumeReclaimPolicy: Retain
  volumeMode: Block
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  creationTimestamp: null
  finalizers:
  - kubernetes.io/pvc-protection
  labels:
    app: projects-service
    app-guid: design-center-projects-service
    asset: service
    chart: design-center-projects-service
    company: mulesoft
    component: projects
    component-asset: projects-service
    example: test
    heritage: Tiller
    product: design-center
    product-component: design-center-projects
    release: design-center-projects-service
  name: projects-service-nfs-block
  selfLink: /api/v1/namespaces/design-center/persistentvolumeclaims/projects-service-nfs-block
spec:
  accessModes:
  - ReadWriteOnce
  dataSource: null
  resources:
    requests:
      storage: 20Gi
  selector:
    matchLabels:
      class: projects-service-nfs
  storageClassName: ""
  volumeMode: Block
  volumeName: projects-service-nfs

Version:

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-08T16:31:10Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.1", GitCommit:"4ed3216f3ec431b140b1d899130a69fc671678f4", GitTreeState:"clean", BuildDate:"2018-10-05T16:36:14Z", GoVersion:"go1.10.4", Compiler:"gc", Platform:"linux/amd64"}
-- Jorge Silva
kubernetes
nfs

1 Answer

11/29/2018

Looks like at some point you updated/expanded the PVC? which is calling:

func (expc *expandController) pvcUpdate(oldObj, newObj interface{})
...

The in the function it's trying to find a plugin for expansion and it can't find it with this:

volumePlugin, err := expc.volumePluginMgr.FindExpandablePluginBySpec(volumeSpec)
if err != nil || volumePlugin == nil {
    err = fmt.Errorf("didn't find a plugin capable of expanding the volume; " +
        "waiting for an external controller to process this PVC")
    ...
    return
}

If you see this document it shows that the following volume types support PVC expansion with in-tree plugins: AWS-EBS, GCE-PD, Azure Disk, Azure File, Glusterfs, Cinder, Portworx, and Ceph RBD. So NFS is not one of them and that's why you are seeing the event. Looks like it could be supported in the future or also it could be supported with a custom plugin.

If you haven't updated the PVC I would recommend using the same capacity for the PV and PVC as described here

-- Rico
Source: StackOverflow