参考文档:https://rook.github.io/docs/rook/v1.12/Getting-Started/quickstart/#prerequisites
1、下载部署文件
git clone --single-branch --branch v1.12.4 https://github.com/rook/rook.git
2、部署 Rook Operator
cd rook/deploy/examples
kubectl create -f crds.yaml -f common.yaml -f operator.yaml
3、创建 Ceph 集群
kubectl create -f cluster.yaml
4、安装Rook 工具箱
kubectl create -f toolbox.yaml
5、安装ceph控制台,控制台的访问不详说,可以参考上面的参考文档
kubectl create -f dashboard-external-https.yaml
6、查看rook-ceph是否正常运行
[root@h03 ~]# kubectl -n rook-ceph get pod
NAME READY STATUS RESTARTS AGE
csi-cephfsplugin-provisioner-d77bb49c6-n5tgs 5/5 Running 0 140s
csi-cephfsplugin-provisioner-d77bb49c6-v9rvn 5/5 Running 0 140s
csi-cephfsplugin-rthrp 3/3 Running 0 140s
csi-rbdplugin-hbsm7 3/3 Running 0 140s
csi-rbdplugin-provisioner-5b5cd64fd-nvk6c 6/6 Running 0 140s
csi-rbdplugin-provisioner-5b5cd64fd-q7bxl 6/6 Running 0 140s
rook-ceph-crashcollector-minikube-5b57b7c5d4-hfldl 1/1 Running 0 105s
rook-ceph-mgr-a-64cd7cdf54-j8b5p 2/2 Running 0 77s
rook-ceph-mgr-b-657d54fc89-2xxw7 2/2 Running 0 56s
rook-ceph-mon-a-694bb7987d-fp9w7 1/1 Running 0 105s
rook-ceph-mon-b-856fdd5cb9-5h2qk 1/1 Running 0 94s
rook-ceph-mon-c-57545897fc-j576h 1/1 Running 0 85s
rook-ceph-operator-85f5b946bd-s8grz 1/1 Running 0 92m
rook-ceph-osd-0-6bb747b6c5-lnvb6 1/1 Running 0 23s
rook-ceph-osd-1-7f67f9646d-44p7v 1/1 Running 0 24s
rook-ceph-osd-2-6cd4b776ff-v4d68 1/1 Running 0 25s
rook-ceph-osd-prepare-node1-vx2rz 0/2 Completed 0 60s
rook-ceph-osd-prepare-node2-ab3fd 0/2 Completed 0 60s
rook-ceph-osd-prepare-node3-w4xyz 0/2 Completed 0 60s
7、创建cephfs
kubectl create -f filesystem.yaml
8、配置存储
kubectl create -f csi/cephfs/storageclass.yaml
9、创建pvc示例
# 创建pvc的yaml文件
cat <<EOF > common-data-pvc.yml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: common-data-pvc
namespace: huwang
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1024Gi
storageClassName: rook-cephfs
EOF
# 部署pvc
kubectl create -f common-data-pvc.yml
标签:kubectl,存储,rook,create,ceph,yaml,Running,集群
From: https://www.cnblogs.com/gatling/p/18311195