【容器化】OpenEBS部署

官网

official-website:https://docs.openebs.io/

简介

官方说明:OpenEBS helps Developers and Platform SREs easily deploy Kubernetes Stateful Workloads that require fast and highly reliable container attached storage.
OpenEBS turns any storage available on the Kubernetes worker nodes into local or distributed Kubernetes Persistent Volumes.
OpenEBS Local and Distributed volumes are implemented using a collection of OpenEBS Data Engines. OpenEBS Control Plane integrates deeply into Kubernetes and uses Kubernetes to manage the provisioning, scheduling and maintenance of OpenEBS Volumes.
OpenEBS supports hyperconverged and disaggregated deployments. OpenEBS is the leading choice for NVMe based storage deployments.

准备

安装iscsid服务

官方说明:https://docs.openebs.io/docs/next/prerequisites.html
This guide will help you to verify that your Kubernetes worker nodes have the required prerequisites to install OpenEBS and use OpenEBS Volumes to run your Kubernetes Stateful Workloads. In addition, you will learn about how to customize the installer according to your managed Kubernetes provider.
OpenEBS provides block volume support through the iSCSI protocol. Therefore, the iSCSI client (initiator) presence on all Kubernetes nodes is required. Choose the platform below to find the steps to verify if the iSCSI client is installed and running or to find the steps to install the iSCSI client.

1
2
3
4
# 所有节点都需要安装
yum install iscsi-initiator-utils -y
systemctl enable --now iscsid
cat /etc/iscsi/initiatorname.iscsi

配置Master节点可被调度

1
kubectl taint nodes <Master节点名称> node-role.kubernetes.io/master:NoSchedule-

部署

1
2
# Master节点执行
kubectl apply -f https://openebs.github.io/charts/openebs-operator.yaml

查看是否安装成功

1
2
# 查看OpenEBS的pod是否都处于Running状态
kubectl get pod -n openebs

(可选)配置默认Storage Class

1
kubectl patch storageclass <storageclass-name> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

卸载

1
2
3
# 下载卸载脚本
curl -o /usr/local/src/openebs-uninstall.sh https://raw.githubusercontent.com/openebs/charts/gh-pages/scripts/uninstall/uninstall.sh
# Master节点中执行卸载脚本

(•̀ᴗ•́)و ̑̑

Share