-
Notifications
You must be signed in to change notification settings - Fork 13
/
project_notes.txt
157 lines (124 loc) · 3.95 KB
/
project_notes.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
================ AKS ======================
Register Azure Account Features
-------------------------------
az provider register -n Microsoft.ContainerService
az provider register -n Microsoft.Network
az provider register -n Microsoft.Compute
az provider register -n Microsoft.DocumentDB
Create/Delete Kubernetes RG and Cluster
---------------------------------------
az login --username <username> --password <password>
az group create `
--resource-group RG-EastUS-AKS-VoterDemo `
--location eastus
az aks create `
--name AKS-Cluster-VoterDemo `
--resource-group RG-EastUS-AKS-VoterDemo `
--node-count 1 `
--generate-ssh-keys `
--kubernetes-version 1.8.2
az aks get-credentials `
--name AKS-Cluster-VoterDemo `
--resource-group RG-EastUS-AKS-VoterDemo
az aks delete `
--name AKS-Cluster-VoterDemo `
--resource-group RG-EastUS-AKS-VoterDemo
Install kubectl
---------------
az acs kubernetes install-cli `
--install-location C:\Users\gary.stafford\kubectl.exe
az acs kubernetes install-cli
Add to %PATH% Environment Variables
Kubernetes Dashboard
--------------------
az aks browse `
--name AKS-Cluster-VoterDemo `
--resource-group RG-EastUS-AKS-VoterDemo
Upgrade Kubernetes (didn't work!)
---------------------------------
az aks get-versions `
--name AKS-Cluster-VoterDemo `
--resource-group RG-EastUS-AKS-VoterDemo
az aks upgrade `
--name AKS-Cluster-VoterDemo `
--resource-group RG-EastUS-AKS-VoterDemo `
--kubernetes-version 1.8.2
Re-build Images
---------------
docker login
./gradlew build -x test
docker build -t garystafford/voter-service:0.2.105 .
docker push garystafford/voter-service:0.2.105
./gradlew build -x test
docker build -t garystafford/candidate-service:0.2.28 .
docker push garystafford/candidate-service:0.2.28
grunt build
docker build -t garystafford/voter-client:0.2.44 .
docker push garystafford/voter-client:0.2.44
docker build -t garystafford/voter-api-gateway:0.2.24 .
docker push garystafford/voter-api-gateway:0.2.24
Test Locally with Docker Compose vs. Kubernetes
-----------------------------------------------
docker-compose up -d
docker ps
Covert Docker Compose File with kompose
---------------------------------------
kompose convert -f docker-compose.yml
Create Kubenetes Resources
--------------------------
kubectl create -f .\voter-deployment.yaml
kubectl create -f .\voter-service.yaml
kubectl get services
kubectl describe service voter
Populate Candidate and Voter data
-----------------------------------
http://api.voter-demo.com/candidate/simulation
http://api.voter-demo.com/voter/simulation
Other Commands
--------------
# Shell into Pod container
kubectl get pods
kubectl exec -it voter-6dd484fc87-nvv6d -- /bin/sh
# replace Service
kubectl replace --force -f .\voter-deployment.yaml
# delete pod (it will be replaced)
kubectl delete pod gateway-7889d8bd4f-x6c74
# view logs
kubectl get pods
kubectl logs voter-64c8b64dfc-2dznc
kubectl get nodes
kubectl config view
kubectl cluster-info
az aks get-versions `
--name AKS-Cluster-VoterDemo `
--resource-group RG-EastUS-AKS-VoterDemo
Software
--------
Azure AKS Preview
Kubernetes v1.8.2
Docker CE for Windows v17.11.0
Azure CLI v2.0.21
kubectl v1.8.3 (client)
Kompose v1.4.0
PowerShell 5.1 (instead of Windows Command Prompt)
Windows 10 Enterprise 64-bit laptop
References
----------
https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough
https://kubernetes.io/docs/tutorials/kubernetes-basics/deploy-intro/
https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-deploy-application
https://kubernetes.io/docs/user-guide/kubectl-cheatsheet/
New Notes
=========
Login-AzureRmAccount
Get-AzureRMLocation
az provider register -n Microsoft.DocumentDB
az provider show -n Microsoft.DocumentDB
https://docs.microsoft.com/en-us/azure/cosmos-db/create-mongodb-java
az cosmosdb create `
--name voterapp `
--resource-group RG-EastUS-AKS-VoterDemo `
--location "East US=0" `
--kind MongoDB `
--debug
# Will automatically try to register resource provider