简体   繁体   English

kubernetes:使用iSCSI和NFS的动态持久卷配置

[英]kubernetes : dynamic persistent volume provisioning using iSCSI and NFS

I am using Kubernetes 1.4 persistent volume support, iSCSI/NFS PV and PVC successfully, in my containers. 我正在容器中成功使用Kubernetes 1.4持久卷支持,iSCSI / NFS PV和PVC。 However it needs to first provision the storage by specifying the capacity both at PV creation and during claiming the storage. 但是,它首先需要在创建PV和声明存储的过程中通过指定容量来配置存储。

My requirement is to just provide storage to cluster(and don't want to mention the capacity of storage) and let users/developers claim the storage based on their requirements. 我的要求是仅向集群提供存储(不想提及存储容量),并让用户/开发人员根据其要求声明存储。 So need to use dynamic provisioning using StorageClass. 因此需要使用通过StorageClass进行动态配置。 Just declare the storage with details and let developers claim it based on their needs. 只需声明存储的详细信息,然后让开发人员根据他们的需求进行声明即可。

However got confused about using dynamic volume provisioning for iSCSI and NFS using Storage class and not getting exact steps to follow. 但是,对于使用存储类为iSCSI和NFS使用动态卷配置而感到困惑,却没有获得确切的步骤。 As per documentation i need to use external volume plugin for both these types and it has already been made available as a part of incubator project - https://github.com/kubernetes-incubator/external-storage/ . 根据文档,我需要为这两种类型使用外部卷插件,并且已经作为孵化器项目的一部分提供了它-https: //github.com/kubernetes-incubator/external-storage/ But i am not getting how to load/run that external provisioner(i need to run it as a container itself??i guess) and then write storage class with details of iSCSI/NFS storage. 但是我没有得到如何加载/运行该外部供应商的信息(我想我需要将其作为容器本身来运行?),然后编写带有iSCSI / NFS存储详细信息的存储类。

Can somebody who has already done/used it can guide/provide pointers on this? 有人已经可以做/使用它了吗?

Thanks in advance, picku 在此先感谢,picku

The project you pointed to is specific to iSCSI targets running targetd. 您指向的项目特定于目标运行的iSCSI目标。 You basically download the YAML files here https://github.com/kubernetes-incubator/external-storage/tree/master/iscsi/targetd/kubernetes , modify them with your storage provider's parameters and deploy the pods using kubectl create. 您基本上可以在这里https://github.com/kubernetes-incubator/external-storage/tree/master/iscsi/targetd/kubernetes下载YAML文件,使用存储提供商的参数对其进行修改,并使用kubectl create部署pod。 In your pods you need to specify the a storageclass. 在pod中,您需要指定一个storageclass。 The storageclass then specifies a the iSCSI provisioner. 然后,该存储类将指定iSCSI供应器。 There are more steps but that's the gist of it. 还有更多步骤,但这就是要点。

See this link for more detailed instructions https://github.com/kubernetes-incubator/external-storage/tree/master/iscsi/targetd 请参阅此链接以获取更详细的说明https://github.com/kubernetes-incubator/external-storage/tree/master/iscsi/targeted

the OpenEBS community has folks running this way afaik. OpenEBS社区让人们以这种方式运行afaik。 There is a blog here for example explaining one approach supporting WordPress: https://blog.openebs.io/setting-up-persistent-volumes-in-rwx-mode-using-openebs-142632244cb2 这里有一个博客,举例说明了一种支持WordPress的方法: https : //blog.openebs.io/setting-up-persistent-volumes-in-rwx-mode-using-openebs-142632244cb2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM