openebs部署使用cstor-分布式(复制)
在Kubernetes环境中部署OpenEBS作为存储平台,并使用其cStor存储引擎创建分布式复制卷,可以通过以下步骤进行:
- 安装OpenEBS Operator:
kubectl apply -f https://openebs.github.io/charts/openebs-operator.yaml
- 创建存储池(Pool),例如使用所有节点上的磁盘:
apiVersion: openebs.io/v1alpha1
kind: StoragePoolClaim
metadata:
name: cstor-pool-create
spec:
name: cstor-pool
type: disk
maxPools: 3
poolSpec:
poolType: striped
disks:
diskList:
- diskList/node-1/disk1
- diskList/node-2/disk1
- diskList/node-3/disk1
- 创建分布式复制卷(Volume),假设存储池名称为
cstor-pool
:
apiVersion: openebs.io/v1alpha1
kind: CStorPoolCluster
metadata:
name: cstor-pool-cluster
spec:
pools:
- poolSpec:
poolType: striped
replicaCount: 3
---
apiVersion: openebs.io/v1alpha1
kind: CStorVolume
metadata:
name: cstor-vol-dist-rep
spec:
capacity: 5Gi
iqn: iqn.2016-09.com.openebs.cstor:cstor-vol-dist-rep
targetip: 10.4.1.2
targetport: "3260"
casType: cstor
replication: 3
poolInfo:
poolName: cstor-pool
- 创建持久化卷(PersistentVolume, PV)和持久化卷请求(PersistentVolumeClaim, PVC):
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: cstor-pvc-dist-rep
spec:
storageClassName: openebs-cstor
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
确保你的Kubernetes集群已经准备好,并且kubectl
已经配置好可以访问该集群。以上步骤中的YAML文件需要根据你的实际环境进行相应的修改,例如磁盘的路径、CStorPoolCluster的配置、PV的存储类名称等。
评论已关闭