参考:https://blog.51cto.com/foxhound/2553979

条件:三台服务器要单独挂载一个空的磁盘

#ceph cluster
mkdir ceph
cd ceph
wget https://raw.githubusercontent.com/rook/rook/v1.8.5/deploy/examples/crds.yaml
wget https://raw.githubusercontent.com/rook/rook/v1.8.5/deploy/examples/common.yaml
wget https://raw.githubusercontent.com/rook/rook/v1.8.5/deploy/examples/operator.yaml
wget https://raw.githubusercontent.com/rook/rook/v1.8.5/deploy/examples/cluster.yaml
wget https://raw.githubusercontent.com/rook/rook/v1.8.5/deploy/examples/toolbox.yaml

kubectl apply -f crds.yaml
kubectl apply -f common.yaml
kubectl apply -f operator.yaml
kubectl apply -f cluster.yaml

# rbd
mkdir rbd
cd rbd
wget https://raw.githubusercontent.com/rook/rook/v1.8.5/deploy/examples/csi/rbd/storageclass.yaml
wget https://raw.githubusercontent.com/rook/rook/v1.8.5/deploy/examples/csi/rbd/pvc.yaml
wget https://raw.githubusercontent.com/rook/rook/v1.8.5/deploy/examples/csi/rbd/pod.yaml
kubectl apply -f storageclass.yaml
kubectl apply -f pvc.yaml
kubectl apply -f pod.yaml

#cephfs
mkdir cephfs
cd cephfs
wget https://raw.githubusercontent.com/rook/rook/v1.8.5/deploy/examples/csi/cephfs/storageclass.yaml
wget https://raw.githubusercontent.com/rook/rook/v1.8.5/deploy/examples/filesystem.yaml
wget https://raw.githubusercontent.com/rook/rook/v1.8.5/deploy/examples/csi/cephfs/pvc.yaml
wget https://raw.githubusercontent.com/rook/rook/v1.8.5/deploy/examples/csi/cephfs/pod.yaml

kubectl apply -f storageclass.yaml
kubectl apply -f filesystem.yaml
kubectl apply -f pvc.yaml
kubectl apply -f pod.yaml

#通过nodeport暴露后台

wget  https://raw.githubusercontent.com/rook/rook/v1.8.5/deploy/examples/dashboard-external-https.yaml
kubectl apply -f  dashboard-external-https.yaml

管理后台密码获取:

kubectl -n rook-ceph get secret rook-ceph-dashboard-password -o yaml | grep "password:"| awk '{print$2}'|base64 -di

工具:

kubectl -n rook-ceph exec -it deploy/rook-ceph-tools -- bash

ceph -s

更多参考:https://github.com/rook/rook/tree/v1.8.5

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐