-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathstop-and-delete.sh
More file actions
executable file
·43 lines (34 loc) · 1007 Bytes
/
stop-and-delete.sh
File metadata and controls
executable file
·43 lines (34 loc) · 1007 Bytes
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
#!/bin/bash
kubectl delete statefulset solr
kubectl delete statefulset zk
kubectl delete svc solr-service
kubectl delete svc solrcluster
kubectl delete svc zk-service
kubectl delete svc zkensemble
kubectl delete configmap solr-config
kubectl delete configmap solr-cluster-config
kubectl delete configmap zookeeper-config
kubectl delete configmap zookeeper-ensemble-config
PVC=$(kubectl get pvc | grep -E "volzookeeper-zk-\d+|volsolr-solr-\d+" | awk '{ print $1}')
if [ "$PVC" == "" ]
then
echo "persistent volume claim not found"
else
kubectl delete pvc $PVC
fi
PV=$(kubectl get pv | grep "default/volsolr-solr-" | awk '{ print $1}')
if [ "$PV" == "" ]
then
echo "persistent volume not found"
else
kubectl delete pv $PV
fi
PV=$(kubectl get pv | grep "default/volzookeeper-zk-" | awk '{ print $1}')
if [ "$PV" == "" ]
then
echo "persistent volume not found"
else
kubectl delete pv $PV
fi
kubectl delete storageclass store-solrcluster
kubectl delete storageclass store-zkensemble