forked from khaled99b/kubernetes-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkube.sh
46 lines (45 loc) · 1.37 KB
/
kube.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
if [[ $1 =~ "up" ]]
then
az vm start --ids $(az vm list --query "[].id" -g mykubeacs -o tsv) --no-wait
az vm start --ids $(az vm list --query "[].id" -g mykubeazurenet -o tsv) --no-wait
az vm start --ids $(az vm list --query "[].id" -g mykubecalico -o tsv) --no-wait
fi
if [[ $1 =~ "down" ]]
then
az vm deallocate --ids $(az vm list --query "[].id" -g mykubeacs -o tsv) --no-wait
az vm deallocate --ids $(az vm list --query "[].id" -g mykubeazurenet -o tsv) --no-wait
az vm deallocate --ids $(az vm list --query "[].id" -g mykubecalico -o tsv) --no-wait
fi
if [[ $1 =~ "acs" ]]
then
if [[ $2 =~ "up" ]]
then
az vm start --ids $(az vm list --query "[].id" -g mykubeacs -o tsv) --no-wait
fi
if [[ $2 =~ "down" ]]
then
az vm deallocate --ids $(az vm list --query "[].id" -g mykubeacs -o tsv) --no-wait
fi
fi
if [[ $1 =~ "azurenet" ]]
then
if [[ $2 =~ "up" ]]
then
az vm start --ids $(az vm list --query "[].id" -g mykubeazurenet -o tsv) --no-wait
fi
if [[ $2 =~ "down" ]]
then
az vm deallocate --ids $(az vm list --query "[].id" -g mykubeazurenet -o tsv) --no-wait
fi
fi
if [[ $1 =~ "calico" ]]
then
if [[ $2 =~ "up" ]]
then
az vm start --ids $(az vm list --query "[].id" -g mykubecalico -o tsv) --no-wait
fi
if [[ $2 =~ "down" ]]
then
az vm deallocate --ids $(az vm list --query "[].id" -g mykubecalico -o tsv) --no-wait
fi
fi