forked from mjy8/MongoDB-in-Kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
teardownmongo.sh
34 lines (24 loc) · 894 Bytes
/
teardownmongo.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
#!/bin/bash
#Cleanup the Shard replicaset
#for i in 0 1 2 3 4 5
#do
#kubectl exec mongodbshardstateful-${i} -c mongodshardcontainer -- bash -c "rm -rfd /data/db"
#done
kubectl delete statefulsets mongodbshardstateful
kubectl delete services mongodbshardservice
kubectl delete statefulsets mongodbshardstateful2
kubectl delete services mongodbshardservice2
kubectl delete pvc -l role=mongoshard
#kubectl delete pods mongodshard-0 --grace-period=0 --force
#Cleanup the config replicaset
#for i in 0 1 2 3 4 5
#do
#kubectl exec mongodbconfigstateful-${i} -c mongodshardcontainer -- bash -c "rm -rfd /data/db"
#done
#Cleanup the Config replicaset
kubectl delete statefulsets mongodbconfigstateful
kubectl delete services mongodbconfigservice
kubectl delete pvc -l role=mongoconfig
#Cleanup the Routers
kubectl delete statefulsets mongosrouter
kubectl delete services mongodbroutersvc