You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: labs/lab4/readme.md
+54-21Lines changed: 54 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
-
# Cafe Demo / Redis Deployment
1
+
# Cafe Demo Deployment
2
2
3
3
## Introduction
4
4
5
-
In this lab, you will deploy the Nginx Cafe Demo, and Redis In Memory cache applications to your AKS Clusters. You will configure Nginx Ingress to expose these applications external to the Clusters. You will use the Nginx Plus Dashboard to watch the Ingress Resources.
5
+
In this lab, you will deploy the Nginx Cafe Demo app to your AKS Cluster. You will configure Nginx Ingress to expose this applications external to the Cluster. You will use the Nginx Plus Dashboard to watch the Kubernetes and Ingress Resources.
- You must have both Nginx Ingress Controllers running
29
-
- You must have both the NIC Dashboards available
27
+
- You must have your AKS Cluster up and running
28
+
- You must have your Nginx Ingress Controller running
29
+
- You must have your NIC Dashboard available
30
+
- Optional: You must have your Second AKS cluster, Nginx Ingress, and Dashboard running
30
31
- Familiarity with basic Linux commands and commandline tools
31
32
- Familiarity with basic Kubernetes concepts and commands
32
33
- Familiarity with Kubernetes NodePort
@@ -36,7 +37,7 @@ By the end of the lab you will be able to:
36
37
37
38
<br/>
38
39
39
-
## Deploy the Nginx Cafe Demo app
40
+
## Deploy the Nginx Cafe Demo app in AKS1 Cluster
40
41
41
42

42
43
@@ -46,15 +47,15 @@ In this section, you will deploy the "Cafe Nginx" Ingress Demo, which represents
46
47
- Matching coffee and tea services
47
48
- Cafe VirtualServer
48
49
49
-
The Cafe application that you will deploy looks like the following diagram below. *BOTH* AKS clusters will have the Coffee and Tea pods and services, with NGINX Ingress routing the traffic for /coffee and /tea routes, using the `cafe.example.com` Hostname. There is also a third hidden service, more on that later!
50
+
The Cafe application that you will deploy looks like the following diagram below. The AKS cluster will have the Coffee and Tea pods and services, with NGINX Ingress routing the traffic for /coffee and /tea routes, using the `cafe.example.com` Hostname. There is also a third hidden service, more on that later!
50
51
51
52

52
53
53
54
1. Inspect the `lab4/cafe.yaml` manifest. You will see we are deploying 3 replicas of each the coffee and tea Pods, and create a matching Service for each.
54
55
55
-
2. Inspect the `lab4/cafe-vs.yaml` manifest. This is the Nginx Ingress VirtualServer CRD (Custom Resource Definition) used by Nginx Ingress to expose these apps, using the `cafe.example.com` Hostname. You will also see that active healthchecks are enabled, and the /coffee and /tea routes are being used. (NOTE: The VirtualServer CRD from Nginx is an `upgrade` to the standard Kubernetes Ingress object).
56
+
2. Inspect the `lab4/cafe-vs.yaml` manifest. This is the Nginx Ingress VirtualServer CRD (Custom Resource Definition) used by Nginx Ingress to expose these apps, using the `cafe.example.com` Hostname. You will also see that active healthchecks are enabled, and the /coffee and /tea routes are being used. (NOTE: The VirtualServer CRD from Nginx unlocks all the Plus features of Nginx, and is an `upgrade` to the standard Kubernetes Ingress object).
56
57
57
-
3. Deploy the Cafe application by applying these two manifests in first cluster:
58
+
3. Deploy the Cafe application by applying these two manifests in the first cluster:
58
59
59
60
> Make sure your Terminal is the `nginx-azure-workshops/labs` directory for all commands during this Workshop.
60
61
@@ -140,15 +141,19 @@ The Cafe application that you will deploy looks like the following diagram below
140
141
141
142
>**NOTE:** The `STATE` should be `Valid`. If it is not, then there is an issue with your yaml manifest file (cafe-vs.yaml). You could also use `kubectl describe vs cafe-vs` to get more information about the VirtualServer you just created.
142
143
143
-
7. Check your Nginx Plus Ingress Controller Dashboard forfirst cluster(`n4a-aks1`), at http://dashboard.example.com:9001/dashboard.html. You should now see `cafe.example.com`in the **HTTP Zones** tab, and 2 each of the coffee and tea Pods in the **HTTP Upstreams** tab. Nginx is health checking the Pods, so they should show a Green status.
144
+
7. Check your Nginx Plus Ingress Controller Dashboard forfirst cluster(`n4a-aks1`), at http://dashboard.example.com:9001/dashboard.html. You should now see `cafe.example.com`in the **HTTP Zones** tab, and 2 each of the coffee and tea Pods in the **HTTP Upstreams** tab. Nginx is health checking the Pods, so they should show a Green status, and the successfull Health Checks counter increasing.
>**NOTE:** You should see two Coffee/Tea pods in Cluster 1.
150
+
>**NOTE:** You should see two each Coffee/Tea pods in Cluster AKS1.
151
+
152
+
<br/>
150
153
151
-
## Deploy the Nginx Cafe Demo app in the 2nd cluster
154
+
## Optional: Deploy the Nginx Cafe Demo app in the 2nd cluster
155
+
156
+
If you have completed the Optional deployment of a Second AKS Cluster (n4a-aks2), running with the Nginx Ingress Controller and the Dashboard, you can use the following steps to deploy the Nginx Cafe Demo app to your Second cluster.
152
157
153
158
1. Repeat the previous section to deploy the Cafe Demo app in your second cluster (`n4a-aks2`), don't forget to change your Kubectl Context using below command.
154
159
@@ -163,20 +168,20 @@ The Cafe application that you will deploy looks like the following diagram below
163
168
164
169
2. Use the same /lab4 `cafe` and `cafe-vs` manifests.
165
170
166
-
>*However - do not Scale down the coffee and tea replicas, leave three of each pod running in AKS2.*
167
-
168
171
```bash
169
172
kubectl apply -f lab4/cafe.yaml
170
173
kubectl apply -f lab4/cafe-vs.yaml
171
174
```
172
175
176
+
>*However - do not Scale down the coffee and tea replicas, leave three of each pod running in AKS2.*
177
+
173
178
3. Check your Second Nginx Plus Ingress Controller Dashboard, at http://dashboard.example.com:9002/dashboard.html. You should find the same HTTP Zones, and 3 each of the coffee and tea pods for HTTP Upstreams.
## Deploy Redis In Memory Caching in AKS Cluster 2 (n4a-aks2)
184
+
## Optional: Deploy Redis In Memory Caching in Cluster AKS2 (n4a-aks2)
180
185
181
186
Azure | Redis
182
187
:--------------:|:--------------:
@@ -302,6 +307,34 @@ In this exercise, you will deploy Redis in your second cluster (`n4a-aks2`), and
302
307
303
308
```
304
309
310
+
1. Inspect the Nginx TransportServer manifests for Redis Leader and Redis Follower, `redis-leader-ts.yaml` and `redis-follower-ts.yaml` respectively. Take note you are creating a Layer4, TCP Transport Server, listening on the Redis standard port 6379. You are limiting the active connections to 100, and using the `Least Time Last Byte` Nginx Plus load balancing algorithm - telling Nginx to pick the *fastest* Redis pod based on Response Time for new TCP connections!
311
+
312
+
```nginx
313
+
# NIC Plus TransportServer file
314
+
# Add ports 6379 for Redis Leader
315
+
# Chris Akker, Jan 2024
316
+
#
317
+
apiVersion: k8s.nginx.org/v1alpha1
318
+
kind: TransportServer
319
+
metadata:
320
+
name: redis-leader-ts
321
+
spec:
322
+
listener:
323
+
name: redis-leader-listener
324
+
protocol: TCP
325
+
upstreams:
326
+
- name: redis-upstream
327
+
service: redis-leader
328
+
port: 6379
329
+
maxFails: 3
330
+
maxConns: 100
331
+
failTimeout: 10s
332
+
loadBalancingMethod: least_time last_byte # use fastest pod
333
+
action:
334
+
pass: redis-upstream
335
+
336
+
```
337
+
305
338
1. Create the Nginx Ingress Transport Servers, for Redis Leader and Follow traffic, using the Transport Server CRD:
306
339
307
340
```bash
@@ -412,7 +445,7 @@ Service Port | External NodePort | Name
412
445
6380 | 32380 | redis follower
413
446
9000 | 32090 | dashboard
414
447
415
-
You will use these new Redis NodePorts for your Nginx for Azure upstreams in the next Lab.
448
+
You will use these new Redis NodePorts for your Nginx for Azure upstreams in an Optional Lab Exercise.
0 commit comments