Kubernetes 驱动需求

Longhorn可用于Kubernetes,通过Longhorn Container Storage Interface(CSI)驱动程序或Longhorn Flexvolume驱动程序提供持久存储。Longhorn将自动部署其中一个驱动程序,具体取决于Kubernetes集群配置。用户还可以在部署yaml文件中指定驱动程序。CSI是首选。

环境检查脚本

我们编写了一个脚本来帮助用户获取足够的信息来正确配置设置。

在安装之前,运行:

  1. curl -sSfL https://raw.githubusercontent.com/rancher/longhorn/master/scripts/environment_check.sh | bash

示例结果:

  1. daemonset.apps/longhorn-environment-check created
  2. waiting for pods to become ready (0/3)
  3. all pods ready (3/3)
  4. MountPropagation is enabled!
  5. cleaning up...
  6. daemonset.apps "longhorn-environment-check" deleted
  7. clean up complete

请记下MountPropagation状态。

CSI 驱动需求

  1. Kubernetes v1.10+
    1. CSI已针对此版本的Kubernetes进行测试版发布,默认情况下已启用。
    2. 默认情况下,它在Kubernetes v1.10中启用,但是一些早期版本的RKE可能无法启用它。
    3. 如果无法满足上述条件,Longhorn将退回到Flexvolume驱动程序。

检查您的设置是否满足CSI要求

  1. 使用以下命令检查Kubernetes server版本

    1. kubectl version

    结果:

    1. Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:17:39Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
    2. Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.1", G itCommit:"d4ab47518836c750f9949b9e0d387f20fb92260b", GitTreeState:"clean", BuildDate:"2018-04-12T14:14:26Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

    The Server Version should be v1.10 or above.

  2. The result of environment check script should contain MountPropagation is enabled!.

Flexvolume驱动要求

  1. Kubernetes v1.8+
  2. 确保curl,findmnt,grep,awk和blkid已安装在Kubernetes集群的每个节点。