forked from cyz/Maratona-Kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path3. aks-kubernetes-az.sh
48 lines (35 loc) · 1.26 KB
/
3. aks-kubernetes-az.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
RESOURCE=k8s-course-aks
CLUSTER_NAME=k8s-cluster
ADMIN_USER_NAME=azureuser
ADMIN_USER_PWD=Erick@123345
VM_SIZE=Standard_B1s
LOCATION=eastus
# eastus, westeurope, centralus, canadacentral, canadaeast
az group create --name $RESOURCE --location $LOCATION
az provider register -n Microsoft.ContainerService
az provider register -n Microsoft.Storage
az provider register -n Microsoft.Network
az provider register -n Microsoft.Compute
# az aks install-cli
# az aks create –n $CLUSTER_NAME –g $RESOURCE
# sudo chown -R $(whoami) / usr/local/bin
# sudo chmod 755 /usr/local/lib
az aks create -g k8s-course-aks-1\
--name k8s-cluster\
--dns-name-prefix k8s-cluster\
--node-vm-size Standard_B1s
--node-count 2
time;
az aks create --resource-group $RESOURCE\
--name $CLUSTER_NAME \
--dns-name-prefix $CLUSTER_NAME \
--generate-ssh-keys \
--node-count 1 \
--node-vm-size $VM_SIZE
time;
az aks get-credentials --resource-group $RESOURCE --name $CLUSTER_NAME
az aks browse --resource-group $RESOURCE --name $CLUSTER_NAME
az aks delete --name $CLUSTER_NAME --resource-group $RESOURCE --yes
az group delete --name $RESOURCE --yes
az aks scale --resource-group=myResourceGroup --name=myAKSCluster --node-count 3
kubectl scale --replicas=5 deployment/azure-vote-front