其他分享
首页 > 其他分享> > 清除已安装的rook-ceph集群

清除已安装的rook-ceph集群

作者:互联网

官方文档地址:https://rook.io/docs/rook/v1.8/ceph-teardown.html

如果要拆除群集并启动新群集,请注意需要清理的以下资源:

删除现有的资源

kubectl delete -n rook-ceph cephblockpool replicapool
kubectl delete storageclass rook-ceph-block
kubectl delete storageclass csi-cephfs

kubectl -n rook-ceph delete cephcluster rook-ceph

kubectl delete -f operator.yaml
kubectl delete -f common.yaml
kubectl delete -f crds.yaml

删除每个主机中的/var/lib/rook目录(默认是这个目录)

删除磁盘数据


# yum -y install gdisk

#!/usr/bin/env bash
DISK="/dev/sdb" # 修改具体的磁盘

# Zap the disk to a fresh, usable state (zap-all is important, b/c MBR has to be clean)

# You will have to run this step for all disks.
sgdisk --zap-all $DISK

# Clean hdds with dd # 机械磁盘使用这个命令清除磁盘数据
dd if=/dev/zero of="$DISK" bs=1M count=100 oflag=direct,dsync

# Clean disks such as ssd with blkdiscard instead of dd # 固态磁盘使用这个命令清除磁盘数据,若不是固态磁盘则会提示不支持这一步操作
blkdiscard $DISK

# These steps only have to be run once on each node
# If rook sets up osds using ceph-volume, teardown leaves some devices mapped that lock the disks.
ls /dev/mapper/ceph-* | xargs -I% -- dmsetup remove %

# ceph-volume setup can leave ceph-<UUID> directories in /dev and /dev/mapper (unnecessary clutter)
rm -rf /dev/ceph-*
rm -rf /dev/mapper/ceph--*

# Inform the OS of partition table changes
partprobe $DISK

标签:kubectl,rook,dev,ceph,集群,磁盘,delete
来源: https://www.cnblogs.com/sanduzxcvbnm/p/15767248.html