简体   繁体   English

Kubernetes自定义卷插件与动态配置

[英]Kubernetes Custom Volume Plugin with Dynamic Provisioning

I have a proprietary file-system and I would like to use it for providing file storage to my K8S pods. 我有一个专有的文件系统,我想用它来为我的K8S pod提供文件存储。 I am currently running K8S v1.5.1, but open upgrade to 1.6 if need be. 我目前正在运行K8S v1.5.1,但如果需要,可以打开升级到1.6。

I would like to make use of Dynamic Provisioning so that the volumes are created on need basis. 我想使用动态预配置,以便根据需要创建卷。 I went through the official documentation on kubernetes.io and this is what I have understood so far: 我浏览了关于kubernetes.io的官方文档,这是我目前所理解的:

  1. I need to write a Kubernetes Custom volume-plugin for my proprietary file-system. 我需要为我的专有文件系统编写一个Kubernetes Custom卷插件。
  2. I need to create a StorageClass which makes use of a provisoner that provisions volumes from my proprietary filesystem 我需要创建一个StorageClass,它使用一个从我的专有文件系统中提供卷的辅助工具
  3. I then create a PVC that refers to my StorageClass 然后我创建一个引用我的StorageClass的PVC
  4. I then create my Pods referring to my storage class by name. 然后我按名称创建我的存储类。

What I am not able to make out is: 我无法弄清楚的是:

  1. Is Provisoner referred by Storage Class and K8S Volume Plugin one and the same? Provisoner是由Storage Class和K8S Volume Plugin引用的吗? If they are different, how? 如果他们不一样,怎么样?
  2. There is mention of External Provisoner in K8S documentation . K8S文档中提到了External Provisoner Does this mean I can write the K8S Volume Plugin for my filesystem out-of-tree (outside K8S code)? 这是否意味着我可以为我的文件系统树外编写K8S卷插件(在K8S代码之外)?
  3. My filesystem provides REST APIs to create filesystem volumes. 我的文件系统提供REST API来创建文件系统卷。 Can I invoke them in my provisoner/volume plugin? 我可以在我的provisoner / volume插件中调用它们吗?
  4. If I write an out-of-tree plugin, how do I load it in my K8S cluster so that it can be used to provision volumes using the Storage Class? 如果我编写了一个树外插件,如何将其加载到我的K8S群集中,以便可以使用存储类来配置卷?

Appreciate any help in answering any or all of the above. 在回答任何或所有上述内容时,感谢您的任何帮助。

Thanks! 谢谢!

Is Provisoner referred by Storage Class and K8S Volume Plugin one and the same? If they are different, how? It should be same if you want to provision the storage using that plugin. 如果要使用该插件配置存储,则应该相同。

There is mention of External Provisoner in K8S documentation. Does this mean I can write the K8S Volume Plugin for my filesystem out-of-tree (outside K8S code)? Yes, thats correct. 对,那是正确的。

My filesystem provides REST APIs to create filesystem volumes. Can I invoke them in my provisoner/volume plugin?

Yes, as long as the client is part of the provisioner code. 是的,只要客户端是供应商代码的一部分。

If I write an out-of-tree plugin, how do I load it in my K8S cluster so that it can be used to provision volumes using the Storage Class?

It can run as a container or you can invoke it by a binary execution model. 它可以作为容器运行,也可以通过二进制执行模型调用它。

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

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