openEBS安装
环境准备
- OpenEBS要求配置iSCSI客户端,并且在worker nodes上运行iscsid服务
yum -y install iscsi-initiator-utils systemctl enable --now iscsid
- 节点临时移除 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
-
创建 OpenEBS 的 namespace
kubectl create ns openebs
-
添加 helm 资源库
helm repo add openebs https://openebs.github.io/charts helm repo update
-
安装 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.
-
设置默认 StorageClass
kubectl patch storageclass openebs-hostpath -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
建立测试应用验证服务是否传教