-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrookoff.sh
executable file
·51 lines (44 loc) · 1.26 KB
/
rookoff.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -x
# Scale down the rook-ceph-operator
kubectl -n rook-ceph scale --replicas=0 deployment rook-ceph-operator
# Unset all the ceph OSD params
OSD_PARAMS="noout nobackfill norecover norebalance nodown pause"
for i in $OSD_PARAMS; do
kubectl -n rook-ceph exec -it deployment.apps/rook-ceph-tools -- ceph osd unset $i
sleep 1
done
read -p "Continue (Y/N)? " cont
if [ ${cont,} != "y" ]; then
exit 0
fi
# Scale down all the deployments
DEPLOYMENTLIST="csi-cephfsplugin-provisioner
csi-rbdplugin-provisioner
rook-ceph-crashcollector-k0s-node1
rook-ceph-crashcollector-k0s-node2
rook-ceph-crashcollector-k0s-node3
rook-ceph-exporter-k0s-node1
rook-ceph-exporter-k0s-node2
rook-ceph-exporter-k0s-node3
rook-ceph-exporter-k0s-node4
rook-ceph-mgr-a
rook-ceph-mgr-b
rook-ceph-osd-0
rook-ceph-osd-1
rook-ceph-osd-2
rook-ceph-osd-3
rook-ceph-mgr-a
rook-ceph-mgr-b
rook-ceph-mon-a
rook-ceph-mon-b
rook-ceph-mon-c
rook-ceph-operator"
for i in $DEPLOYMENTLIST; do
kubectl -n rook-ceph scale --replicas=0 deployment $i
done
# Patch, and Disable all the daemonsets
DAEMONSET_LIST="csi-cephfsplugin csi-rbdplugin rook-discover"
for i in $DAEMONSET_LIST; do
kubectl -n rook-ceph patch daemonset $i -p '{"spec": {"template": {"spec":{"nodeSelector":{"nonexisting":"true"}}}}}'
done