Skip to content

Commit 45c1f31

Browse files
committed
update readme
1 parent 0e924a2 commit 45c1f31

File tree

6 files changed

+209
-82
lines changed

6 files changed

+209
-82
lines changed

README.md

Lines changed: 3 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Check out my [blog](https://medium.com/@thangchung), my [chat](https://spectrum.
5858
- **[`.NET Core SDK 2.x`](https://dotnet.microsoft.com/download)** - .NET Framework and .NET Core, including ASP.NET and ASP.NET Core
5959
- **[`nodejs 10.x`](https://nodejs.org/en/download)** - JavaScript runtime built on Chrome's V8 JavaScript engine
6060
- **[`typescript`](https://www.typescriptlang.org)** - a typed superset of JavaScript that compiles to plain JavaScript
61+
- **[identityserver](https://identityserver.io)** - the Identity and Access Control solution for .NET Core
6162
- **[`gRPC`](https://grpc.io)** - a high-performance, open-source universal RPC framework
6263
- **[`create-react-app`](https://facebook.github.io/create-react-app)** - a modern web app by running one command
6364
- **[`vue-cli`](https://cli.vuejs.org/)** - standard tooling for Vue.js development
@@ -208,91 +209,11 @@ There are several individual µservices and infrastructure components that make
208209

209210
### <strong>Development environment</strong> - up and running locally with "Docker for desktop"
210211

211-
1. Make sure we have **`Docker for Desktop`** running with **`Kubernetes`** option enabled. We need to install **`kubectl`**, **`helm`** and **`istioctl`** on the build machine as well.
212-
213-
2. From current console, type `bash` to enter `Linux Subsystem (Ubuntu)`
214-
215-
3. Then `cd` into your root of project
216-
217-
```
218-
> ./deploys/scripts/build-all-images.sh
219-
```
220-
221-
It should run and package all docker images.
222-
223-
4. Download and install [istio-1.0.0](https://github.com/istio/istio/releases/tag/1.0.0) on the box, and unzip it into somewhere, then initialize it with following commands
224-
225-
```
226-
> cd <istio-1.0.0 path>
227-
> kubectl create -f install/kubernetes/helm/helm-service-account.yaml
228-
> helm init --service-account tiller --upgrade
229-
> helm install install/kubernetes/helm/istio --name istio --namespace istio-system
230-
```
231-
232-
More information about installing `istio` can be found at https://istio.io/docs/setup/kubernetes/helm-install
233-
234-
5. Apply `istioctl` command to `coolstore` chart (please create k8s folder in folder deploys)
235-
236-
```
237-
> helm template deploys/charts/coolstore -f deploys/charts/coolstore/values.dev.yaml > deploys/k8s/coolstore.local.yaml
238-
> istioctl kube-inject -f deploys/k8s/coolstore.local.yaml | kubectl apply -f -
239-
```
240-
241-
6. Add hosts file with following content
242-
243-
```
244-
127.0.0.1 api.coolstore.local
245-
127.0.0.1 id.coolstore.local
246-
127.0.0.1 coolstore.local
247-
```
248-
249-
Waiting for the container provision completed
250-
251-
7. Install `coolstore-istio` chart
252-
253-
```
254-
> helm install deploys\charts\coolstore-istio --name coolstore-istio
255-
```
256-
257-
8. Access to following URLs
258-
259-
```
260-
> curl -I http://coolstore.local # website
261-
> curl -I http://api.coolstore.local # api gateway
262-
> curl -I http://id.coolstore.local # identity provider
263-
```
264-
265-
9. Clean up `coolstore` chart as
266-
267-
```
268-
> kubectl delete -f deployment/istio/coolstore.local.yaml
269-
> helm delete coolstore-istio --purge
270-
> helm delete istio --purge
271-
```
272-
273-
**Notes**:
274-
275-
1. Global path
276-
277-
> Set `PATH` for `docker`, `kubectl`, `helm`, and `istioctl`.
278-
279-
2. Run with Nginx (not recommendation)
280-
> If you want to run just only `Kubernetes` + `nginx-ingress` go to `deploys/charts/coolstore/values.yaml`, and modify as following
281-
>
282-
> ```
283-
> nginx:
284-
> enabled: true
285-
> ```
286-
>
287-
> Then run the `helm` command as
288-
>
289-
> ```
290-
> helm install --name cs-nginx stable/nginx-ingress
291-
> ```
212+
See https://vietnam-devs.github.io/docs/development/up-running-d4d-aks/#docker-for-desktop
292213

293214
### <strong>Staging and Production environments</strong> - up and Running on Azure Kubernetes Service (AKS)
294215

295-
[5 steps to bring CoolStore’s Service Mesh to Azure Kubernetes Service](https://medium.com/@thangchung/5-steps-to-bring-coolstores-service-mesh-to-azure-kubernetes-service-aks-9cd1a5aa008a)
216+
See https://vietnam-devs.github.io/docs/development/up-running-d4d-aks/#azure-kubernetes-service-aks
296217

297218
## µService development
298219

Loading
Loading
Loading
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
# Up and running manually on Docker for desktop and AKS
2+
3+
## Docker for desktop
4+
5+
### Step 1
6+
7+
Make sure we have **`Docker for Desktop`** running with **`Kubernetes`** option enabled. We need to install **`kubectl`**, **`helm`** and **`istioctl`** on the build machine as well.
8+
9+
### Step 2
10+
11+
From current console, type `bash` to enter `Linux Subsystem (Ubuntu)`
12+
13+
### Step 3
14+
15+
Then `cd` into your root of project
16+
17+
```
18+
> ./deploys/scripts/build-all-images.sh
19+
```
20+
21+
It should run and package all docker images.
22+
23+
### Step 4
24+
25+
Download and install [istio-1.0.0](https://github.com/istio/istio/releases/tag/1.0.0) on the box, and unzip it into somewhere, then initialize it with following commands
26+
27+
```
28+
> cd <istio-1.0.0 path>
29+
> kubectl create -f install/kubernetes/helm/helm-service-account.yaml
30+
> helm init --service-account tiller --upgrade
31+
> helm install install/kubernetes/helm/istio --name istio --namespace istio-system
32+
```
33+
34+
More information about installing `istio` can be found at https://istio.io/docs/setup/kubernetes/helm-install
35+
36+
### Step 5
37+
38+
Apply `istioctl` command to `coolstore` chart (please create k8s folder in folder deploys)
39+
40+
```
41+
> helm template deploys/charts/coolstore -f deploys/charts/coolstore/values.dev.yaml > deploys/k8s/coolstore.local.yaml
42+
> istioctl kube-inject -f deploys/k8s/coolstore.local.yaml | kubectl apply -f -
43+
```
44+
45+
### Step 6
46+
47+
Add hosts file with following content
48+
49+
```
50+
127.0.0.1 api.coolstore.local
51+
127.0.0.1 id.coolstore.local
52+
127.0.0.1 coolstore.local
53+
```
54+
55+
Waiting for the container provision completed
56+
57+
### Step 7
58+
59+
Install `coolstore-istio` chart
60+
61+
```
62+
> helm install deploys\charts\coolstore-istio --name coolstore-istio
63+
```
64+
65+
### Step 8
66+
67+
Access to following URLs
68+
69+
```
70+
> curl -I http://coolstore.local # website
71+
> curl -I http://api.coolstore.local # api gateway
72+
> curl -I http://id.coolstore.local # identity provider
73+
```
74+
75+
### Step 9
76+
77+
Clean up `coolstore` chart as
78+
79+
```
80+
> kubectl delete -f deployment/istio/coolstore.local.yaml
81+
> helm delete coolstore-istio --purge
82+
> helm delete istio --purge
83+
```
84+
85+
**_Notes_**:
86+
87+
- Global path: set `PATH` for `docker`, `kubectl`, `helm`, and `istioctl`.
88+
89+
- Run with Nginx (not recommendation): if you want to run just only `Kubernetes` + `nginx-ingress` go to `deploys/charts/coolstore/values.yaml`, and modify as following
90+
91+
```bash
92+
nginx:
93+
enabled: true
94+
```
95+
96+
Then run the `helm` command as
97+
98+
```bash
99+
helm install --name cs-nginx stable/nginx-ingress
100+
```
101+
102+
## Azure Kubernetes Service (AKS)
103+
104+
### Step 1: Install Docker for Windows and enable Kubernetes, Ubuntu WSL, kubectl, istioctl, helm and az
105+
106+
### Step 2: Create coolstore AKS, enabled RBAC. Minimum should have 3 nodes (istio pilot needs it)
107+
108+
![](create-cluster-aks-1.png)
109+
110+
And make sure checking to `enable RBAC` as following
111+
112+
![](create-cluster-aks-2.png)
113+
114+
Follow up with next steps to finish creating the cluster. It normally takes around `20 to 30 minutes`.
115+
116+
After it finished, we should be able to access to the `Kubernetes Dashboard` with following steps
117+
118+
```bash
119+
$ az aks get-credentials --resource-group coolstore --name coolstore
120+
$ kubectl proxy
121+
```
122+
123+
But now, you will not be able to access to Kubernetes Dashboard. Then we need to add several steps then
124+
125+
```bash
126+
$ kubectl create clusterrolebinding kubernetes-dashboard -n kube-system --clusterrole=cluster-admin --serviceaccount=kube-system:kubernetes-dashboard
127+
```
128+
129+
Get the `token` subsequently
130+
131+
```bash
132+
$ kubectl get secret \$(kubectl get serviceaccount kubernetes-dashboard -n kube-system -o jsonpath="{.secrets[0].name}") -n kube-system -o jsonpath="{.data.token}" | base64 --decode
133+
```
134+
135+
Paste the token to login page as http://localhost:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/#!/login
136+
137+
### Step 3: Install Istio on AKS
138+
139+
Due to some of the timeout issues for helm at now so that I couldn’t use helm to install, but `export` it to yaml file, then using kubectl to create it on AKS. `Download istio 1.0.0`, then upzip to somewhere on the machine. Following command to export and deploy it to AKS
140+
141+
```bash
142+
$ helm template install/kubernetes/helm/istio --namespace istio-system > istio-dump.yaml
143+
$ kubectl create -f istio-dump.yaml
144+
$ kubectl create -f istio-dump.yaml
145+
```
146+
147+
### Step 4: Install Coolstore on AKS
148+
149+
Get the `internal istio-ingress IP` by using
150+
151+
```bash
152+
$ kubectl get services istio-ingressgateway -n istio-system -o=jsonpath={.spec.clusterIP}
153+
```
154+
155+
Create the `values.aks.yaml` with content like
156+
157+
gateway:
158+
ip: 10.0.106.82
159+
160+
Then run helm command
161+
162+
```bash
163+
> helm template deploys/charts/coolstore -f deploys/charts/coolstore/values.aks.yaml > deploys/k8s/dev-all-in-one.aks.yaml
164+
```
165+
166+
Finally, we `inject sidecar` with this command
167+
168+
```bash
169+
$ istioctl kube-inject -f deploys/k8s/dev-all-in-one.aks.yaml | kubectl apply -f -
170+
```
171+
172+
### Step 5: Put mapping for hosts file
173+
174+
Get `external IP` on istio ingress by using
175+
176+
```bash
177+
$ kubectl get svc -n istio-system
178+
```
179+
180+
It should print out something like
181+
182+
```bash
183+
...
184+
istio-ingressgateway LoadBalancer 10.106.52.19 localhost 80:31380/TCP,443:31390/TCP,31400:31400/TCP,15011:32131/TCP,8060:30958/TCP,15030:31983/TCP,15031:30365/TCP 8d
185+
...
186+
```
187+
188+
Then, we only need to copy `10.106.52.19` to `C:\Windows\System32\drivers\etc\hosts` file as following
189+
190+
```bash
191+
10.106.52.19 id.coolstore.aks
192+
10.106.52.19 api.coolstore.aks
193+
10.106.52.19 coolstore.aks
194+
```
195+
196+
From now on, we can access website at `http://coolstore.aks`, identity provider at `http://id.coolstore.aks`, and api gateway at `http://api.coolstore.aks`
197+
198+
Let say we access to `http://api.coolstore.aks/cart/swagger`, then we should see
199+
200+
![](cart-svc-open-api.png)
201+
202+
And the website at `http://coolstore.aks`
203+
204+
More information at https://hackernoon.com/5-steps-to-bring-coolstores-service-mesh-to-azure-kubernetes-service-aks-9cd1a5aa008a

docs/site/sitemap.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
items:
3636
- title: Local development craftsmanship
3737
file: local-development-craftmanship.md
38+
- title: Up and running manually on Docker for desktop and AKS
39+
file: up-running-d4d-aks.md
3840
- title: Up and running on Docker and Docker Compose
3941
file: up-running-docker-docker-compose.md
4042
- title: Up and running on Cloud-native platform

0 commit comments

Comments
 (0)