新加一块50G磁盘 /dev/sdb
所有节点开启ip forward
cat <<EOF > /etc/sysctl.d/ceph.conf
net.ipv4.ip_forward = 1net.bridge.bridge-nf-call-ip6tables = 1net.bridge.bridge-nf-call-iptables = 1EOF
sysctl --system
git clone -b release-0.8 https://github.com/rook/rook.git
创建operator
Cd rook-ceph/cluster/example/kubernetes/ceph
Kubectl apply -f operator.yaml
image.png
Kubectl apply -f cluster.yaml
部署cluster的时候需设置kubernetes节点间的ssh免密通信,否则会因配置文件传输不成功导致节点mon组件crashloopbackoff
Ssh-keygen
Ssh-copy-id mwk8snode
Ssh-copy-id mwk8snode2
部署dashboard NodePort
Kubectl apply extenal-dashboard.yaml
通过NodePort访问dashboard
image.png
lsblk查看空闲磁盘挂载情况
image.png
创建StorageClass
Kubectl apply -f storageclass.yaml
image.png
发现报错
image.png
官方解释可能是operator和mon的通信问题
image.png
将operator和cluster的namespace统一为rook-ceph
image.png
在jenkins的pvc中声明rook的stroageclass:
image.png
image.png
绑定成功
网友评论