Skip to content

Commit

Permalink
Minor tweaks for Lab1-7 (#48)
Browse files Browse the repository at this point in the history
* lab1 minor verbiage
* lab2 minor updates
* lab3 minor updates
* minor lab4 update
* minor lab5 updates
* lab6 updates
* minor lab7 updates
  • Loading branch information
sdutta9 authored Jun 7, 2024
1 parent 2560cdc commit 522a502
Show file tree
Hide file tree
Showing 16 changed files with 308 additions and 174 deletions.
2 changes: 1 addition & 1 deletion labs/lab1/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ In this section you will be looking at NGINX for Azure resource that you created

![n4a Index Page](media/lab1_n4a_index_page.png)

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.
8. Congratulations!!! you have successfully deployed the sample index page within NGINX for Azure. This also 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.

<br/>

Expand Down
11 changes: 10 additions & 1 deletion labs/lab2/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ By the end of the lab you will be able to:
```bash
sudo docker images
```
```bash
sudo docker ps -a
```
Expand Down Expand Up @@ -442,6 +445,12 @@ NGINX aaS | Docker | Cafe Demo
# include /etc/nginx/includes/*.conf; # shared files
}
# stream {
# include /etc/nginx/stream/*.conf; # Stream TCP nginx files
# }
```
Notice that the Nginx standard / Best Practice of placing the HTTP Context config files in the `/etc/nginx/conf.d` folder is being followed, and the `include` directive is being used to read these files at Nginx configuration load time.
Expand Down Expand Up @@ -485,7 +494,7 @@ NGINX aaS | Docker | Cafe Demo
Connection: keep-alive
Expires: Thu, 04 Apr 2024 21:36:29 GMT
Cache-Control: no-cache
X-Proxy-Pass: cafe-nginx
X-Proxy-Pass: cafe_nginx
```

Try the coffee and tea URLs, at http://cafe.example.com/coffee and http://cafe.example.com/tea.
Expand Down
Binary file modified labs/lab3/media/aks-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed labs/lab3/media/aks-icon2.png
Binary file not shown.
10 changes: 7 additions & 3 deletions labs/lab3/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ Azure Kubernetes Service is a service provided for Kubernetes on Azure infrastru

### Deploy first Kubernetes Cluster with Azure CLI

1. With the use of single Azure CLI command, you will deploy a production-ready AKS cluster with some additional options. (**This will take a while**).
![AKS Icon](media/aks-icon.png)

First, initialise the Environment variables based on your setup, which are passed to the Azure CLI command as shown below:
With the use of single Azure CLI command, you will deploy a production-ready AKS cluster with some additional options. (**This will take a while**).

1. First, initialise the Environment variables based on your setup, which are passed to the Azure CLI command as shown below:

```bash
## Set environment variables
Expand Down Expand Up @@ -185,7 +187,7 @@ In this section, you will be installing NGINX Plus Ingress Controller in first A

However, for this workshop, a Trial License will be provided to you, so you can pull and run the Nginx Plus Commercial version of the Ingress Controller. This is NOT the same Ingress Controller provided by the Kubernetes Community. (If you are unsure which Ingress Controller you are using in your other Kubernetes environments, you can find a link to the Blog from Nginx that explains the differences).

1. Once your Workshop Instructor has provide the JWT file, follow these instructions to create a Kubernetes Secret named `regcred`, of type `docker-registry`. You will need to create the Secret in both of your AKS clusters.
1. Once your Workshop Instructor has provided the JWT file, follow these instructions to create a Kubernetes Secret named `regcred`, of type `docker-registry`. You will need to create the Secret in both of your AKS clusters.

1. Copy the `nginx-repo.jwt` file provided in the `/labs/lab3` directory within your cloned workshop repository.

Expand Down Expand Up @@ -323,6 +325,8 @@ Just a quick test, is your Nginx Plus Ingress Controller running, and can you se

### Deploy second Kubernetes Cluster with Azure CLI

![AKS Icon](media/aks-icon.png)

In this section, similar to how you deployed the first AKS cluster, you will deploy a second AKS cluster named `n4a-aks2` which has 4 nodes.

1. Run below commands to deploy your second AKS cluster (**This will take a while**).
Expand Down
5 changes: 5 additions & 0 deletions labs/lab4/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ The Cafe application that you will deploy looks like the following diagram below
>*However - do not Scale down the coffee and tea replicas, leave three of each pod running in AKS2.*
```bash
kubectl apply -f lab4/cafe.yaml
kubectl apply -f lab4/cafe-vs.yaml
```
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.
![Cafe Upstreams](media/lab4_cafe-upstreams-3.png)
Expand Down
6 changes: 3 additions & 3 deletions labs/lab5/aks2-nic-headless.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ upstream aks2_nic_headless {
# direct to nginx-ingress Headless Service Endpoint Cluster IP
# Resolvers set to kube-dns Endpoints List

resolver 172.16.4.64 172.16.4.224 valid=10s ipv6=off status_zone=kube-dns;
resolver 172.16.20.59 172.16.20.81 valid=10s ipv6=off status_zone=kube-dns;

# Server name must follow this Kubernetes Service Name format
# server <service name>.<namespace>.svc.cluster.local

server nginx-ingress-headless.nginx-ingress.svc.cluster.local:80 resolve;
# server 172.16.4.74:80;
server nginx-ingress-headless.nginx-ingress.svc.cluster.local:80 resolve;


keepalive 32;

Expand Down
18 changes: 12 additions & 6 deletions labs/lab5/cafe.example.com.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,21 @@ server {
#
# return 200 "You have reached cafe.example.com, location /\n";

proxy_pass http://cafe_nginx; # Proxy AND load balance to Docker VM
add_header X-Proxy-Pass cafe_nginx; # Custom Header
proxy_pass http://cafe_nginx; # Proxy AND load balance to Docker VM
add_header X-Proxy-Pass cafe_nginx; # Custom Header

#proxy_pass http://aks1_ingress; # Proxy AND load balance to AKS1 Nginx Ingress
#add_header X-Proxy-Pass aks1_ingress; # Custom Header
# proxy_pass http://windowsvm; # Proxy AND load balance to a list of servers
# add_header X-Proxy-Pass windowsvm; # Custom Header

#proxy_pass http://aks2_ingress; # Proxy AND load balance to AKS2 Nginx Ingress
#add_header X-Proxy-Pass aks1_ingress; # Custom Header
# proxy_pass http://aks1_ingress; # Proxy AND load balance to AKS1 Nginx Ingress
# add_header X-Proxy-Pass aks1_ingress; # Custom Header

# proxy_pass http://aks2_ingress; # Proxy AND load balance to AKS2 Nginx Ingress
# add_header X-Proxy-Pass aks2_ingress; # Custom Header

# proxy_pass http://$upstream; # Use Split Clients config
# add_header X-Proxy-Pass $upstream; # Custom Header

}

}
16 changes: 6 additions & 10 deletions labs/lab5/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@ http {


# access_log off;
server_tokens N4A-$nginx_version-cakker;
server_tokens "";
server {
# listen 80 default_server;
listen 80;
server_name www.example.com;
status_zone www.example.com;
add_header X-Host-Header $host;
listen 80 default_server;
server_name localhost;
location / {
status_zone /;
# Points to a directory with a basic html index file with
# a "Welcome to NGINX as a Service for Azure!" page
root /var/www;
Expand All @@ -40,8 +36,8 @@ http {

}

stream {
# stream {

include /etc/nginx/stream/*.conf; # Stream TCP nginx files
# include /etc/nginx/stream/*.conf; # Stream TCP nginx files

}
# }
Loading

0 comments on commit 522a502

Please sign in to comment.