k8s中安装openEBS

openEBS安装

环境准备

  1. OpenEBS要求配置iSCSI客户端,并且在worker nodes上运行iscsid服务
    yum -y install iscsi-initiator-utils   
    systemctl enable --now iscsid
    
  2. 节点临时移除 k8smaster 上的 Taint
    • 查看
    kubectl describe node k8smaster | grep Taint 
    
    • 移除
    kubectl taint nodes k8smaster node-role.kubernetes.io/master:NoSchedule-
    
    • 安装完毕需要记住恢复 taint
    kubectl taint nodes k8smaster node-role.kubernetes.io/master=:NoSchedule
    

安装 OpenEBS

  1. 创建 OpenEBS 的 namespace

    kubectl create ns openebs
    
  2. 添加 helm 资源库

    helm repo add openebs https://openebs.github.io/charts
    helm repo update
    
  3. 安装 openebs

    helm install --namespace openebs --name openebs openebs/openebs --version 2.1.0
    

    安装完有提示:

    NAME:   openebs
    LAST DEPLOYED: Sun Sep 20 17:03:06 2020
    NAMESPACE: openebs
    STATUS: DEPLOYED
    ...
    Please note that, OpenEBS uses iSCSI for connecting applications with the
    OpenEBS Volumes and your nodes should have the iSCSI initiator installed.
    
    
  4. 设置默认 StorageClass

    kubectl patch storageclass openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
    
    
  5. 建立测试应用验证服务是否传教

你可能感兴趣的:(k8s中安装openEBS)