-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcloud.sh
70 lines (52 loc) · 1.69 KB
/
cloud.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# script to maintain AKS cluster
# script by arun
# az aks install-cli
echo "Create Cluster? [Y,n]"
read input
if [[ $input == "Y" || $input == "y" ]]; then
echo "performing operation"
az group create --name aksrg --location eastus
az aks create --resource-group aksrg --name myAKSCluster --node-count 1 --generate-ssh-keys
az aks install-cli
az aks get-credentials --resource-group aksrg --name myAKSCluster
kubectl get nodes -o wide
kubectl config view
kubectl config current-context
echo "to open cluster : az aks browse --resource-group aksrg --name myAKSCluster"
else
echo "get lost"
fi
echo "Delete Cluster? [Y,n]"
read input
if [[ $input == "Y" || $input == "y" ]]; then
echo "deleting the cluster"
az group delete --name aksrg --yes --no-wait
else
echo "get lost"
fi
############
gcloud config list
gcloud info
gcloud components list
echo "Create Cluster? [Y,n]"
read input
if [[ $input == "Y" || $input == "y" ]]; then
echo "do that"
gcloud container clusters create zeus --machine-type n1-standard-2 --num-nodes 2 --zone us-central1-c
kubectl get nodes -o wide
kubectl config view
kubectl config current-context
kubectl create secret generic hanuman --from-file zeus-python-app-2b3585417c83.json
else
echo "don't do that"
fi
echo "Delete Cluster? [Y,n]"
read input
if [[ $input == "Y" || $input == "y" ]]; then
echo "do that"
gcloud container clusters delete zeus --zone us-central1-c
gcloud config configurations delete zeus
else
echo "don't do that"
fi
#gcloud container clusters get-credentials zeus --zone us-central1-c --project zeus-python-app