Skip to content

Commit 2560cdc

Browse files
authored
Labs 1, 2, 3, 5 and 6 edits (#45)
* refactory in lab5 * lab6 updates * lab1 updates * lab1 updates * updated command for fetching self public IP
1 parent 6942899 commit 2560cdc

25 files changed

+95
-68
lines changed

labs/lab1/media/azure-icon.png

-5.39 KB
Binary file not shown.
-115 KB
Binary file not shown.
Binary file not shown.
102 KB
Loading

labs/lab1/media/nginx-plus-icon.png

-27.2 KB
Binary file not shown.

labs/lab1/readme.md

Lines changed: 59 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ In this lab, you will be adding and configuring the Azure components needed for
88

99
NGINX aaS for Azure |
1010
:-------------------------:|
11-
![NGINX aaS](media/nginx-azure-icon.png)
11+
![NGINX aaS](media/nginx-azure-icon.png)|
1212

1313
<br/>
1414

@@ -36,7 +36,6 @@ By the end of the lab you will be able to:
3636
<br/>
3737

3838
![lab1 diagram](media/lab1_diagram.png)
39-
Lab1 Diagram
4039

4140
<br/>
4241

@@ -65,7 +64,7 @@ Lab1 Diagram
6564
az group create --name s.dutta-workshop --location centralus
6665
```
6766

68-
2. Make sure the new Azure Resource Group has been created by running below command.
67+
1. Make sure the new Azure Resource Group has been created by running below command.
6968

7069
```bash
7170
az group list -o table | grep workshop
@@ -76,7 +75,6 @@ Lab1 Diagram
7675
### Setup your Azure Virtual Network, Subnets and Network Security Group
7776

7877
![lab1 Networks](media/lab1_azure-network.png)
79-
Lab1 Vnet/Subnets
8078

8179
You will create an Azure Vnet for this Workshop. Inside of this Vnet are 4 different subnets, representing various backend networks for Azure resources like Nginx for Azure, VMs, and Kubernetes clusters.
8280

@@ -94,7 +92,7 @@ aks2-subnet | 172.16.20.0/23 | AKS Cluster #2
9492
```bash
9593
## Set environment variables
9694
export MY_RESOURCEGROUP=s.dutta-workshop
97-
export MY_PUBLICIP=$(curl -4 ifconfig.co)
95+
export MY_PUBLICIP=$(curl ipinfo.io/ip)
9896
```
9997

10098
```bash
@@ -226,6 +224,8 @@ aks2-subnet | 172.16.20.0/23 | AKS Cluster #2
226224
}
227225
```
228226
227+
> **NOTE:** Within the output json you should have a `"provisioningState": "Succeeded"` field which validates the command successfully provisioned the resource.
228+
229229
4. Create a subnet that you will use with NGINX for Azure resource. You will also attach the NSG that you just created to this subnet.
230230
231231
```bash
@@ -271,6 +271,8 @@ aks2-subnet | 172.16.20.0/23 | AKS Cluster #2
271271
}
272272
```
273273
274+
> **NOTE:** Within the output json you should have a `"provisioningState": "Succeeded"` field which validates the command successfully provisioned the resource.
275+
274276
5. In similar fashion create three more subnets that would be used with docker virtual machines and AKS clusters in later labs.
275277
276278
```bash
@@ -303,7 +305,6 @@ aks2-subnet | 172.16.20.0/23 | AKS Cluster #2
303305
Your completed Vnet/Subnets should look similar to this:
304306
305307
![lab1 Azure Subnets](media/lab1_azure-subnets.png)
306-
Lab1 Vnet/Subnets
307308
308309
<br/>
309310
@@ -347,6 +348,8 @@ Lab1 Vnet/Subnets
347348
}
348349
```
349350
351+
> **NOTE:** Within the output json you should have a `"provisioningState": "Succeeded"` field which validates the command successfully provisioned the resource.
352+
350353
1. Create a user assigned managed identity that would be tied to the NGINX for Azure resource. This managed identity would be used to read certificates and keys from Azure key vault in later labs.
351354
352355
```bash
@@ -391,15 +394,17 @@ Lab1 Vnet/Subnets
391394
--name nginx4a \
392395
--sku name="standard_Monthly" \
393396
--network-profile front-end-ip-configuration="{public-ip-addresses:[{id:/subscriptions/$MY_SUBSCRIPTIONID/resourceGroups/$MY_RESOURCEGROUP/providers/Microsoft.Network/publicIPAddresses/n4a-publicIP}]}" network-interface-configuration="{subnet-id:/subscriptions/$MY_SUBSCRIPTIONID/resourceGroups/$MY_RESOURCEGROUP/providers/Microsoft.Network/virtualNetworks/n4a-vnet/subnets/n4a-subnet}" \
394-
--identity="{type:UserAssigned,userAssignedIdentities:{/subscriptions/$MY_SUBSCRIPTIONID/resourceGroups/$MY_RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/n4a-useridentity:{}}}"
397+
--identity="{type:'SystemAssigned, UserAssigned',userAssignedIdentities:{/subscriptions/$MY_SUBSCRIPTIONID/resourceGroups/$MY_RESOURCEGROUP/providers/Microsoft.ManagedIdentity/userAssignedIdentities/n4a-useridentity:{}}}"
395398
```
396399
397400
```bash
398401
##Sample Output##
399402
{
400403
"id": "/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/s.dutta-workshop/providers/Nginx.NginxPlus/nginxDeployments/nginx4a",
401404
"identity": {
402-
"type": "UserAssigned",
405+
"principalId": "xxxx-xxxx-xxxx-xxxx-xxxx",
406+
"tenantId": "xxxx-xxxx-xxxx-xxxx-xxxx",
407+
"type": "SystemAssigned, UserAssigned",
403408
"userAssignedIdentities": {
404409
"/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/s.dutta-workshop/providers/Microsoft.ManagedIdentity/userAssignedIdentities/n4a-useridentity": {
405410
"clientId": "xxxx-xxxx-xxxx-xxxx-xxxx",
@@ -456,56 +461,11 @@ Lab1 Vnet/Subnets
456461
457462
<br/>
458463
459-
### Explore Nginx for Azure
460-
461-
<br/>
462-
463-
NGINX as a Service for Azure is a service offering that is tightly integrated into Microsoft Azure public cloud and its ecosystem, making applications fast, efficient, and reliable with full lifecycle management of advanced NGINX traffic services. NGINXaaS for Azure is available in the Azure Marketplace.
464-
465-
NGINXaaS for Azure is powered by NGINX Plus, which extends NGINX Open Source with advanced functionality and provides customers with a complete application delivery solution. Initial use cases covered by NGINXaaS include L4 TCP and L7 HTTP load balancing and reverse proxy which can be managed through various Azure management tools. NGINXaaS allows you to provision distinct deployments as per your business or technical requirements.
466-
467-
In this section you will be looking at NGINX for Azure resource that you created within Azure portal.
468-
469-
1. Open Azure portal within your browser and then open your resource group.
470-
![Portal ResourceGroup home](media/portal_rg_home.png)
471-
472-
2. Click on your NGINX for Azure resource (nginx4a) which should open the Overview section of your resource. You can see useful information like Status, NGINX for Azure resource's public IP, which Nginx version is running, which vnet/subnet it is using, etc.
473-
![Portal N4A home](media/portal_n4a_home.png)
474-
475-
3. From the left pane click on `NGINX Configuration`. As you are opening this resource for first time and you do not have any configuration present, Azure will prompt you to "Get started with a Configuration example". Click on `Populate now` button to start with a sample configuration example.
476-
![nginx conf populate](media/nginx_conf_populate.png)
477-
478-
4. Once you click on the `Populate now` button you will see the configuration editor section has been populated with `nginx.conf` and an `index.html` page. Click on the `Submit` button to deploy this sample config files to the NGINX for Azure resource.
479-
![nginx conf editor](media/nginx_conf_editor.png)
480-
481-
5. Once you have submitted the configuration, you can watch its progress in the notification tab present in right top corner. Intially status would be "Updating NGINX configuration" which would change to "Updated NGINX configuration successfully".
482-
![nginx conf submit success](media/nginx_conf_submit_success.png)
483-
484-
6. Navigate back to Overview section and copy the public IP address of NGINX for Azure resource.
485-
486-
7. In a new browser window, paste the public IP into the address bar. You will notice the sample index page gets rendered into your browser.
487-
![n4a Index Page](media/n4a_index_page.png)
488-
489-
8. This completes the validation of all the resources that you created using Azure CLI. In the upcoming labs you would be modifying the configuration files and exploring various features of NGINX for Azure resources.
490-
491-
<br/>
492-
493464
### Create Log Analytics workspace to collect NGINX error and Access logs from NGINX for azure
494465
495466
In this section you will create a Log Analytics resource that would collect Nginx logs from your Nginx for Azure resource. As this resource takes time to get provisioned and attached to NGINX for Azure resource, you are building it up here.
496467
497-
1. Within the NGINX for Azure resource (nginx4a), navigate to managed identity section by clicking on `Identity` from the left menu. Within this section, inside the `System assigned` tab, enable system managed identity by changing the status to `on`. Click on `Save` to save your changes. Press `Yes` within the "Enable system assigned managed identity" prompt.
498-
![Enable System Identity](media/enable_system_identity.png)
499-
500-
2. If you open up the Notifications pane, you should see a success status as shown below.
501-
![Enable system Identity success](media/enable_system_identity_success.png)
502-
503-
3. Now go back to your terminal and create a Log Analytics workspace resource that you will attach to NGINX for Azure using Azure CLI. This resource would be used to capture and store NGINX error and access logs. Use below command to create this resource.
504-
505-
```bash
506-
## Set environment variables
507-
export MY_RESOURCEGROUP=s.dutta-workshop
508-
```
468+
1. Create a Log Analytics workspace resource that you will attach to NGINX for Azure using Azure CLI. This resource would be used to capture and store NGINX error and access logs. Use below command to create this resource.
509469
510470
```bash
511471
az monitor log-analytics workspace create \
@@ -545,7 +505,7 @@ In this section you will create a Log Analytics resource that would collect Ngin
545505
546506
> **NOTE:** Within the output json you should have a `"provisioningState": "Succeeded"` field which validates the command successfully provisioned the resource.
547507
548-
4. Next you will update your NGINX for Azure resource to enable sending metrics to Azure monitor by setting the `--enable-diagnostics` flag to `true` using below command.
508+
2. Next you will update your NGINX for Azure resource to enable sending metrics to Azure monitor by setting the `--enable-diagnostics` flag to `true` using below command.
549509
550510
```bash
551511
az nginx deployment update \
@@ -584,7 +544,7 @@ In this section you will create a Log Analytics resource that would collect Ngin
584544
}
585545
```
586546
587-
5. The last step that you need to perform to start collecting NGINX logs is to create an Azure diagnostic settings resource that will stream the NGINX logs to the log-analytics workspace that you created in previous step. Run below commands to create this resource.
547+
3. The last step that you need to perform to start collecting NGINX logs is to create an Azure diagnostic settings resource that will stream the NGINX logs to the log-analytics workspace that you created in previous step. Run below commands to create this resource.
588548
589549
```bash
590550
## Set environment variables
@@ -632,7 +592,49 @@ In this section you will create a Log Analytics resource that would collect Ngin
632592
}
633593
```
634594
635-
6. In upcoming labs, you will explore and learn more about NGINX logs and make use of these resources that you built in this section.
595+
4. In upcoming labs, you will explore and learn more about NGINX logs and make use of these resources that you built in this section.
596+
597+
<br/>
598+
599+
### Explore Nginx for Azure
600+
601+
<br/>
602+
603+
NGINX as a Service for Azure is a service offering that is tightly integrated into Microsoft Azure public cloud and its ecosystem, making applications fast, efficient, and reliable with full lifecycle management of advanced NGINX traffic services. NGINXaaS for Azure is available in the Azure Marketplace.
604+
605+
NGINXaaS for Azure is powered by NGINX Plus, which extends NGINX Open Source with advanced functionality and provides customers with a complete application delivery solution. Initial use cases covered by NGINXaaS include L4 TCP and L7 HTTP load balancing and reverse proxy which can be managed through various Azure management tools. NGINXaaS allows you to provision distinct deployments as per your business or technical requirements.
606+
607+
In this section you will be looking at NGINX for Azure resource that you created within Azure portal.
608+
609+
1. Open Azure portal within your browser and then open your resource group.
610+
611+
![Portal ResourceGroup home](media/lab1_portal_rg_home.png)
612+
613+
2. Click on your NGINX for Azure resource (nginx4a) which should open the Overview section of your resource. You can see useful information like Status, NGINX for Azure resource's public IP, which Nginx version is running, which vnet/subnet it is using, etc.
614+
615+
![Portal N4A home](media/lab1_portal_n4a_home.png)
616+
617+
3. From the left pane click on `Settings > NGINX Configuration`. As you are opening this resource for first time and you do not have any configuration present, Azure will prompt you to "Get started with a Configuration example". Click on `Populate now` button to start with a sample configuration example.
618+
619+
![nginx conf populate](media/lab1_nginx_conf_populate.png)
620+
621+
4. Once you click on the `Populate now` button you will see the configuration editor section has been populated with `nginx.conf` and an `index.html` page. Click on the `Submit` button to deploy this sample config files to the NGINX for Azure resource.
622+
623+
![nginx conf editor](media/lab1_nginx_conf_editor.png)
624+
625+
5. Once you have submitted the configuration, you can watch its progress in the notification tab present in right top corner. Intially status would be "Updating NGINX configuration" which would change to "Updated NGINX configuration successfully".
626+
627+
![nginx conf submit success](media/lab1_nginx_conf_submit_success.png)
628+
629+
6. Navigate back to Overview section and copy the public IP address of NGINX for Azure resource.
630+
631+
![Copy IP Address](media/lab1_copy_ip_address.png)
632+
633+
7. In a new browser window, paste the public IP into the address bar. You will notice the sample index page gets rendered into your browser.
634+
635+
![n4a Index Page](media/lab1_n4a_index_page.png)
636+
637+
8. This completes the validation of all the resources that you created using Azure CLI. In the upcoming labs you would be modifying the configuration files and exploring various features of NGINX for Azure resources.
636638

637639
<br/>
638640

labs/lab2/readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ By the end of the lab you will be able to:
105105
106106
```bash
107107
##Set environment variable
108-
export MY_PUBLICIP=$(curl -4 ifconfig.co)
108+
export MY_PUBLICIP=$(curl ipinfo.io/ip)
109109
```
110110
111111
```bash
@@ -561,7 +561,7 @@ Similar to how you deployed an Ubuntu VM, you will now deploy a Windows VM.
561561

562562
```bash
563563
##Set environment variable
564-
export MY_PUBLICIP=$(curl -4 ifconfig.co)
564+
export MY_PUBLICIP=$(curl ipinfo.io/ip)
565565
```
566566

567567
```bash

labs/lab3/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ So why use ports 9001 and 9002 for the NIC Dashboards? Will this work on port 8
823823
```bash
824824
## Set environment variables
825825
export MY_RESOURCEGROUP=s.dutta-workshop
826-
export MY_PUBLICIP=$(curl -4 ifconfig.co)
826+
export MY_PUBLICIP=$(curl ipinfo.io/ip)
827827
```
828828

829829
```bash
File renamed without changes.

labs/lab5/media/lab5_aks1-kubenet.png

95 KB
Loading
93.1 KB
Loading
-224 KB
Binary file not shown.
194 KB
Loading
36.1 KB
Loading

labs/lab5/readme.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Submit your Nginx Configuration. If you have the Server name:port correct, Nginx
139139
140140
In order for Nginx 4 Azure and Nginx Ingress to work correctly, the HTTP Host Headers, and perhaps other headers, will need to be passed. This is done by changing the HTTP Version to 1.1, so that the Host Header can be included.
141141
142-
1. Inspect the `lab5/includes/keepalive.conf`. This is where the HTTP Protocol and Headers are set for proxied traffic. This is a common requirement so it is shared among all the different Nginx configurations.
142+
1. Inspect the `lab5/keepalive.conf`. This is where the HTTP Protocol and Headers are set for proxied traffic. This is a common requirement so it is shared among all the different Nginx configurations.
143143
144144
Using the Nginx for Azure console, create a new file, `/etc/nginx/includes/keepalive.conf`. Use the example provided, just copy/paste.
145145
@@ -309,7 +309,7 @@ Now that you have these new Nginx Upstream blocks created, you can test them.
309309
310310
You can also see this list, using the Nginx Plus Dashboard for the Ingress Controller, check the HTTP Upstreams Tab as before, you should see the Pod IPs for both the coffee-svc and tea-svc.
311311
312-
![Cafe NIC Upstreams](media/lab5_cafe-nic-upstreams.png)
312+
![Cafe NIC Upstreams](media/lab5_cafe-nic1-upstreams.png)
313313
314314
1. **Loadtest Time!** While you are in the Nginx Ingress Dashboard watching the coffee upstreams, throw some load at them using WRK HTTP Load tool.
315315
@@ -444,14 +444,17 @@ You built and used different CNIs and subnets so that you can see the difference
444444
Platform | Docker | AKS1 | AKS2
445445
:--------------:|:--------------:|:-----------------:|:-----------------:
446446
Network Type | Docker | Kubenet | Azure CNI
447-
IP Subnet | 172.18.x.y | 172.16.10.y | 172.16.20.y
447+
POD IP Subnet | 172.18.x.y | 10.244.x.y | 172.16.20.y
448448
449+
AKS1 Pod Network | AKS2 Pod Network
450+
:--------------:|:--------------:
451+
![aks1-kubenet](media/lab5_aks1-kubenet.png) | ![aks2-azurecni](media/lab5_aks2-azurecni.png)
449452
450453
You can also see this list, using the Nginx Plus Dashboard for the Ingress Controller in AKS2 - check the HTTP Upstreams, you should see the Pod IPs for both the coffee-svc and tea-svc.
451454
452455
![Cafe NIC2 Upstreams](media/lab5_cafe-nic2-upstreams.png)
453456
454-
1. **Loadtest Time!** While you are in the Nginx Ingress Dashboard watching the coffee upstreams, throw some load at them:
457+
1. **Loadtest Time!** While you are in the Nginx Ingress Dashboard watching the coffee upstreams, throw some load at them:
455458
456459
Using your local Docker Desktop, you will start and run the WRK loadtest from a container. Try this for a 1 minute loadtest:
457460
@@ -822,7 +825,7 @@ In this exerices, you will use Nginx for Azure to expose the `Redis Leader Servi
822825
```bash
823826
## Set environment variables
824827
export MY_RESOURCEGROUP=c.akker-workshop
825-
export MY_PUBLICIP=$(curl -4 ifconfig.co)
828+
export MY_PUBLICIP=$(curl ipinfo.io/ip)
826829
```
827830

828831
Use Azure CLI to add a new Rule for Redis.
175 KB
Loading
Loading
Loading

0 commit comments

Comments
 (0)