-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkubernetes.txt
82 lines (49 loc) · 1.74 KB
/
kubernetes.txt
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
71
72
73
74
75
76
77
78
79
80
81
82
az login
az account set -s <<>>>>
az group create --name <<>> --location "West europe"
az ad sp create-for-rbac --skip-assignment
az acr create -n mclassaksacr -g mclassaksdemo --sku standard --admin-enabled --location "West europe" --verbose
docker login mclassaksacr.azurecr.io -u <<>> -p <<>>
docker images
docker tag orderwrite:latest mclassaksacr.azurecr.io/orderwrite:latest
docker push mclassaksacr.azurecr.io/orderwrite:latest
az role assignment create --assignee <<>> --scope /subscriptions/f0bb4697-5b29-46cc-8fc9-a4e5ac7800dc/resourceGroups/mclassaksdemo/providers/Microsoft.ContainerRegistry/registries/mclassaksacr --role acrpull
az aks create -g <<>> --name <<>>> --location "West europe" --generate-ssh-keys --kubernetes-version 1.14.7 --node-count 2 --network-plugin azure --enable-addons monitoring --load-balancer-sku standard --vm-set-type VirtualMachineScaleSets --verbose
az aks install-cli
az aks get-credentials -g <<>> -n <<>>
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: mssamplesbook4
spec:
replicas: 1
template:
metadata:
labels:
app: mssample-kub-app4
spec:
containers:
- name: mssample-services-app4
image: nginx:1.15.5
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: mssample-kub-app4
spec:
ports:
- name: http-port
port: 80
targetPort: 80
selector:
app: mssample-kub-app4
type: LoadBalancer
kubectl get pods
kubectl get nodes
kubectl apply -f "C:\\df\\aks-first.yml"
kubectl scale deployment mssamplesbook4 --replicas 3
kubectl autoscale deployment mssamplesbook4 --min 3 --max 5 --cpu-percent=2
kubectl scale deployment mssamplesbook4 --replicas 1
kubectl get pods