forked from kubearmor/kvm-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·41 lines (29 loc) · 911 Bytes
/
setup.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
#!/bin/bash
cluster_clean() {
kubectl delete -f /home/vagrant/KVMService/KVMService/service/kvmservice.yaml
kubectl delete -f /home/vagrant/KVMService/KVMService/operator/kvmsoperator.yaml
CRDS=`kubectl get kew | awk '(NR>1)' |awk '{print $1}'`
echo "MDEBUG: $CRDS"
kubectl delete kew $CRDS
KHPS=`kubectl get khp | awk '(NR>1)' |awk '{print $1}'`
echo "MDEBUG:$KHPS"
kubectl delete khp $KHPS
sudo rm /mnt/gen-script/*
kubectl get kew
kubectl get khp
}
cluster_up() {
kubectl apply -f /home/vagrant/KVMService/KVMService/service/kvmservice.yaml
kubectl apply -f /home/vagrant/KVMService/KVMService/operator/kvmsoperator.yaml
}
if [ $# -eq 1 ]; then
if [ $1 == "clean" ]; then
echo "Cleaning the cluster"
cluster_clean
else
echo "err: invalid commad"
fi
else
echo "Bringing up the cluster"
cluster_up
fi