Skip to content

Commit a560b3c

Browse files
authored
Merge (#17)
1 parent e73ca98 commit a560b3c

23 files changed

+1914
-180
lines changed

ca-notes/LabOutline.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Nginx for Azure Workshop Outline / Summary
22

3-
## Lab 0 - Prequesites - Subscription / Resources
3+
## Lab 0 - Prerequisites - Subscription / Resources
44
## Lab 1 - Azure VNet/Subnet / Network Security Group / Nginx for Azure Overview
5-
## Lab 2 - UbuntuVM/Docker / Windows VM / Cafe Demo Deployment
5+
## Lab 2 - Ubuntu VM / Docker / Windows VM / Cafe Demo Docker Deployment
66
## Lab 3 - AKS / Nginx Plus Ingress Deployment / NIC Dashboard
7-
## Lab 4 - Cafe Demo / Redis Deployment
8-
## Lab 5 - Nginx for Azure Load Balancing / Reverse Proxy
7+
## Lab 4 - Cafe Demo / Redis AKS Deployment
8+
## Lab 5 - Nginx for Azure Load Balancing / Blue/Green/Canary
99
## Lab 6 - Azure Key Vault / TLS Essentials
1010
## Lab 7 - Azure Monitoring / Logging Analytics
1111
## Lab 8 - Nginx Garage or Azure Petshop
@@ -18,11 +18,11 @@
1818

1919
## Introduction
2020

21-
This NGINXpert Workshop will explore the Nginx for Azure Service, available and running in Microsoft's Azure Cloud. As a Cloud Architect, Platform or DevOps Engineer, you will create different Azure Resources and Services, and use Nginx for Azure to load balance, route, terminate TLS, split, cache, rate limit, and use other Nginx functions to manage traffic to these Azure resources. The Workshop is led by Instructors that will show you how to do these things, and explain the technical and business merits of these solutions with Nginx for Azure. As you follow along, the Hands On Lab Exercises will show you how to configure Nginx, and integrate with different Azure Services like Azure Key Vault, Azure Monitoring, Azure Logging / Analytics / Grafana. A variety of different systems and applications are used as examples, including VMs, Docker containers, Kubernetes Clusters, Nginx Ingress Controllers.
21+
This NGINXpert Workshop will explore the Nginx for Azure Service, available and running in Microsoft's Azure Cloud. As a Cloud Architect, Platform or DevOps Engineer, you will create different Azure Resources and Services, and use Nginx for Azure to load balance, route, terminate TLS, split, cache, rate limit, and use other Nginx functions to manage traffic to these Azure resources. The Workshop is led by Instructors that will show you how to do these things, and explain the technical and business merits of these solutions using Nginx for Azure. As you follow along, the Hands On Lab Exercises will show you how to configure Nginx, and integrate with different Azure Services like Azure Key Vault, Azure Monitoring, Azure Logging / Analytics / Grafana. A variety of different systems and applications are used as examples, including VMs, Docker containers, Kubernetes Clusters, Nginx Ingress Controllers.
2222

23-
This is an Intermediate, 200 Level Workshop. Students will require existing skills with Nginx, Azure CLI/Portal, Docker, Linux, and various networking tools. You will also need a Subscription to Azure for the Hands On Labs, with Owner level access to create and configure various Azure Services.
23+
*This is an Intermediate, 200 Level Workshop*, Workshop #3 in the **NGINXpert Series**. Students will require existing skills with Nginx, Azure CLI/Portal, Docker, Linux, and various networking tools. You will also need a Subscription to Azure for the Hands On Labs, with Owner level access to create and configure various Azure Services.
2424

25-
NGINXpert Workshops are also available for Nginx Basics and Nginx Ingress Controller, which are highly recommended as Prerequisites for this Workshop. You can find those on Github as well.
25+
NGINXpert Workshops are also available for Nginx Basics (Workshop #1) and Nginx Ingress Controller (Workshop #2), which are required as Prerequisites for this Workshop. You can find these Workshops on Github, and there are also Nginx classes available from Nginx University. Microsoft has many great Tutorials and examples on Azure Learning, to get you prepared for this Workshop. You can find those at Microsoft Learn.
2626

2727
### Lab 0 - Prequesites - Subscription / Resources
2828

@@ -104,19 +104,17 @@ Configure Nginx for Azure for Redis applications.
104104

105105
<br/>
106106

107-
### Lab 5 - Nginx Load Balancing / Reverse Proxy
107+
### Lab 5 - Nginx for Azure Load Balancing / Blue/Green
108108

109109
- Overview
110-
In this lab, you will configure Nginx for Azure to Load Balance various workloads running in Azure. After successful configuration and adding Nginx Best Practice parameters, you will Load Test these applications, and test multiple load balancing and request routing parameters to suit different use cases.
110+
In this lab, you will configure Nginx for Azure to Load Balance various workloads running in Azure. After successful configuration and adding Nginx Best Practice parameters, you will Load Test these applications, and test multiple load balancing features for different use cases. You will explore, configure, and test the HTTP Split Clients feature in detail.
111111

112112
- Learning Objectives
113113
Configure Nginx for Azure, to Load Balance traffic to both AKS Clusters / Nginx Ingress Controllers.
114+
Profile Redis Leader performance with Redis Benchmark.
115+
Load test various web applications.
116+
Configure Nginx for Azure, to Load Balance Nginx Ingress Controllers as a Kubernetes Headless Service.
114117
Configure HTTP Split Clients, Blue/Green traffic Splitting - route traffic to verious backend systems using 0-100% Ratios.
115-
Load test the Legacy and Modern web applications.
116-
Run an HTTP Load Test on Cafe.
117-
Configure Nginx for Azure, to Load Balance Nginx Ingress Controllers as a Headless Service with ClusterIPs.
118-
Run a Redis Benchmark test on Redis Leader.
119-
Configure Nginx for Azure, to Load Balance Nginx Ingress Controllers as a Headless Service with ClusterIPs.
120118

121119
<br/>
122120

@@ -166,9 +164,12 @@ In this lab, you will deploy an image rich application, and use Nginx Caching to
166164

167165
- Learning Objectives
168166
Deploy JuiceShop in AKS cluster.
167+
Deploy Mygarage on Ubuntu VM.
169168
Expose JuiceShop with Nginx Ingress Controller.
170169
Configure Nginx for Azure for load balancing JuiceShop.
170+
Configure Nginx for Azure for load balancing Mygarage.
171171
Add Nginx Caching to improve delivery of images.
172+
Explore, configure, and test HTTP Request Limits
172173

173174
<br/>
174175

ca-notes/aks/juiceshop/juiceshop-vs.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ spec:
1313
- name: juiceshop
1414
service: juiceshop-svc
1515
port: 80
16-
slow-start: 5s
16+
sessionCookie:
17+
enable: true
18+
name: srv_id
19+
path: /
20+
expires: 1m
21+
domain: .nginxazure.build
22+
#slow-start: 5s
1723
healthCheck:
1824
enable: true
1925
port: 3000

ca-notes/n4a-configs/includes/rate_limits.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Nginx 4 Azure - Mar 2024
2+
# Chris Akker, Shouvik Dutta, Adam Currier - Mar 2024
3+
#
4+
# Define HTTP Request Limit Zones
5+
#
16
limit_req_zone $binary_remote_addr zone=limitone:10m rate=1r/s;
27
limit_req_zone $binary_remote_addr zone=limit10:10m rate=10r/s;
38
limit_req_zone $binary_remote_addr zone=limit100:10m rate=100r/s;
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
# Nginx 4 Azure to AKS1/2 NICs and/or UbuntuVMs for Upstreams
22
# Chris Akker, Shouvik Dutta, Adam Currier - Mar 2024
33
# HTTP Split Clients Configuration for AKS Cluster1/Cluster2 or UbuntuVM ratios
4+
# HTTP to NIC Headless, ClusterIP, no NodePort
45
#
56
split_clients $request_id $upstream {
67

78
# Uncomment the percent wanted for AKS Cluster #1, #2, or UbuntuVM
89
#0.1% aks1_ingress;
910
#1.0% aks1_ingress;
1011
#5.0% aks1_ingress;
11-
30% aks1_ingress;
12-
#50% aks1_ingress;
12+
#30% aks1_ingress;
13+
50% aks1_ingress;
1314
#80% aks1_ingress;
1415
#95% aks1_ingress;
1516
#99% aks1_ingress;
16-
#* aks1_ingress;
17-
30% aks2_ingress;
18-
* cafe_nginx; # Ubuntu VM containers
19-
#* aks1_nic_direct; # Direct to NIC pods - headless/no nodeport
17+
* aks2_ingress;
18+
#30% aks2_ingress;
19+
#30% cafe_nginx; # Ubuntu VM containers
20+
#* aks1_nic_headless; # Direct to NIC pods - headless/no nodeport
2021

2122
}

labs/lab2/nginx.conf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Nginx 4 Azure - Default - Updated Nginx.conf
2+
# Chris Akker, Shouvik Dutta, Adam Currier - Mar 2024
3+
#
4+
user nginx;
5+
worker_processes auto;
6+
worker_rlimit_nofile 8192;
7+
pid /run/nginx/nginx.pid;
8+
9+
events {
10+
worker_connections 4000;
11+
}
12+
13+
error_log /var/log/nginx/error.log error;
14+
15+
http {
16+
access_log off;
17+
server_tokens "";
18+
server {
19+
listen 80 default_server;
20+
server_name localhost;
21+
location / {
22+
# Points to a directory with a basic html index file with
23+
# a "Welcome to NGINX as a Service for Azure!" page
24+
root /var/www;
25+
index index.html;
26+
}
27+
}
28+
}

labs/lab2/readme.md

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ By the end of the lab you will be able to:
4242

4343
## Deploy UbuntuVM with Azure CLI
4444

45+
<< TODO - check variables >>
46+
4547
After logging onto your Azure tenant, set the following Environment variables needed for this lab:
4648

4749
```bash
@@ -53,22 +55,6 @@ export MY_VM_IMAGE="Canonical:0001-com-ubuntu-server-jammy:server-22_04-lts-gen2
5355

5456
```
5557

56-
To see a list of UbuntuVMs available to you, try:
57-
58-
```bash
59-
az vm image list --location $MY_LOCATION --publisher Canonical --output table
60-
61-
```
62-
63-
```bash
64-
#Sample output
65-
You are viewing an offline list of images, use --all to retrieve an up-to-date list
66-
Architecture Offer Publisher Sku Urn UrnAlias Version
67-
-------------- ---------------------------- ----------- -------------- ------------------------------------------------------------ ---------- ---------
68-
x64 0001-com-ubuntu-server-jammy Canonical 22_04-lts-gen2 Canonical:0001-com-ubuntu-server-jammy:22_04-lts-gen2:latest Ubuntu2204 latest
69-
70-
```
71-
7258
Create the Ubuntu VM:
7359

7460
```bash
@@ -262,7 +248,15 @@ Leave your SSH Terminal running, you will use it in the next Exercise.
262248

263249
You will now use Docker Compose to create and deploy three Nginx `ingress-demo` containers. These will be your first group of `backends` that will be used for load balancing with Nginx for Azure.
264250

265-
On the Ubuntu VM, create a new folder in the `/home/azureuser` directory, call it `cafe`.
251+
1. Inspect the `lab2/docker-compose.yml` file. Notice you are pulling the `nginxinc/ingress-demo` image, and starting three containers. The three containers are configured as follows:
252+
253+
Container Name | Name:port
254+
:-------------:|:------------:
255+
docker-web1 | ubuntuvm:81
256+
docker-web2 | ubuntuvm:82
257+
docker-web3 | ubuntuvm:83
258+
259+
1. On the Ubuntu VM, create a new folder in the `/home/azureuser` directory, call it `cafe`.
266260

267261
```bash
268262
azureuser@ubuntuvm: cd $HOME
@@ -272,15 +266,6 @@ azureuser@ubuntuvm: sudo vi docker-compose.yml
272266

273267
```
274268

275-
Inspect the `lab2/docker-compose.yml` file. Notice you are pulling the `nginxinc/ingress-demo` image, and starting three containers. The three containers are configured as follows:
276-
277-
Container Name | Name:port
278-
:-------------:|:------------:
279-
docker-web1 | ubuntuvm:81
280-
docker-web2 | ubuntuvm:82
281-
docker-web3 | ubuntuvm:83
282-
283-
284269
Copy the contents from the `lab2/docker-compose.yml` file, into the same filename on the Ubuntu VM. Save the file and exit VI.
285270

286271
Start up the three Nginx demo containers. This tells Docker to read the compose file and start the three containers:
@@ -297,7 +282,7 @@ sudo docker ps -a
297282

298283
```
299284

300-
It should look similar to this. Notice that each container is listening on a unique TCP port on the Docker host - Ports 81, 82, and 83 for web1, web2 and web3, respectively.
285+
It should look similar to this. Notice that each container is listening on a unique TCP port on the Docker host - Ports 81, 82, and 83 for docker-web1, docker-web2 and docker-web3, respectively.
301286

302287
```bash
303288
#Sample output
@@ -337,7 +322,7 @@ tcp6 0 0 :::4431 :::* LISTEN
337322

338323
```
339324

340-
Yes, looks like ports 81, 82, and 83 are Listening. Note: If you used a different VM, you may need some host Firewall rules to allow traffic to the containers.
325+
Yes, looks like ports 81, 82, and 83 are Listening. Note: If you used a different VM, you may need to update the VM Host Firewall rules to allow traffic to the containers.
341326

342327
Test all three containers with curl:
343328

@@ -510,7 +495,9 @@ Try the coffee and tea URLs, at http://cafe.example.com/coffee and /tea.
510495

511496
You should see a 200 OK Response. Did you see the `X-Proxy-Pass` header - set to the Upstream block name.
512497

513-
Did you notice the `Server` header? This is the Nginx Server Token. Optional - Change the Server token to your name, and Submit your configuration. The server_tokens directive is found in the `nginx.conf` file. Change it from `N4A-$nginx_version`, to `N4A-$nginx_version-myname`, and click Submit.
498+
Did you notice the `Server` header? This is the Nginx Server Token.
499+
500+
**Optional** - Change the Server token to your name, and Submit your configuration. The server_tokens directive is found in the `nginx.conf` file. Change it from `N4A-$nginx_version`, to `N4A-$nginx_version-myname`, and click Submit.
514501

515502
Try the curl again. See the change ? Set it back if you like, the Server token is usually hidden for Security reasons, but you can use it as a quick identity tool temporarily. (Which server did I hit?)
516503

@@ -539,6 +526,8 @@ Congratulations!! You have just completed launching a simple web application wi
539526

540527
<br/>
541528

529+
<< TODO - check and fix >>
530+
542531
## Deploy Windows VM with Azure CLI
543532

544533
After logging onto your Azure tenant, set the following Environment variables needed for this lab:

labs/lab4/cafe-vs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
- name: tea
1616
service: tea-svc
1717
port: 80
18-
slow-start: 20s
18+
#slow-start: 20s
1919
healthCheck:
2020
enable: true
2121
path: /tea
@@ -28,7 +28,7 @@ spec:
2828
- name: coffee
2929
service: coffee-svc
3030
port: 80
31-
slow-start: 20s
31+
#slow-start: 20s
3232
healthCheck:
3333
enable: true
3434
path: /coffee

0 commit comments

Comments
 (0)