Kubernetes NFS Persistent Volumes - multiple claims on same volume? Claim stuck in pending?

后端 未结 4 1808
遥遥无期
遥遥无期 2020-12-17 08:51

Use case:

I have a NFS directory available and I want to use it to persist data for multiple deployments & pods.

I have created a PersistentVolume<

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-17 09:13

    Basically you can't do what you want, as the relationship PVC <--> PV is one-on-one.

    If NFS is the only storage you have available and would like multiple PV/PVC on one nfs export, use Dynamic Provisioning and a default storage class.

    It's not in official K8s yet, but this one is in the incubator and I've tried it and it works well: https://github.com/kubernetes-incubator/external-storage/tree/master/nfs-client

    This will enormously simplify your volume provisioning as you only need to take care of the PVC, and the PV will be created as a directory on the nfs export / server that you have defined.

提交回复
热议问题