Kubernetes : Dynamic Persistent Volume provisioning using NFS

与世无争的帅哥 提交于 2019-12-04 01:18:10

I'm looking into doing the same thing. I found https://github.com/kubernetes-incubator/external-storage/tree/master/nfs, which I think you based your provisioner on?

I think an nfs provider would need to create a unique directory under the path defined. I'm not really sure how this could be done.

Maybe this is better of as an github issue on the kubernetes repo.

Dynamic storage provisioning using NFS doesn't work, better use glusterfs. There's a good tutorial with fixed to common problems while setting up. http://blog.lwolf.org/post/how-i-deployed-glusterfs-cluster-to-kubernetes/

I also tried to enable the NFS provisioner on my kubernetes cluster and at first it didn't work, because the quickstart guide does not mention that you need to apply the rbac.yaml as well (I opened a PR to fix this).

The nfs provisioner works fine for me if I follow these steps on my cluster: https://github.com/kubernetes-incubator/external-storage/tree/master/nfs#quickstart

$ kubectl create -f deploy/kubernetes/deployment.yaml
$ kubectl create -f deploy/kubernetes/rbac.yaml
$ kubectl create -f deploy/kubernetes/class.yaml

Then you should be able to create PVCs like this:

$ kubectl create -f deploy/kubernetes/claim.yaml

You might want to change the folders used for the volume mounts in deployment.yaml to match it with your cluster.

Oswin Noetzelmann

The purpose of StorageClass is to create storage, e.g. from cloud providers (or "Provisioner" as they call it in the kubernetes docs). In case of NFS you only want to get access to existing storage and there is no creation involved. Thus you don't need a StorageClass. Please refer to this blog.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!