Skip to content

Commit 420cdc1

Browse files
authored
Updated NIC and K8s cluster (#80)
* lab2 minor resourcegroup updates * updated k8s version to 1.32 and nic version to v3.7.2 * azure command updates * resourcegroup updates * resourcegroup updates * zonesync updates * minor updates
1 parent 13be876 commit 420cdc1

File tree

10 files changed

+244
-216
lines changed

10 files changed

+244
-216
lines changed

auto-lab.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
NAME="n4a-auto-lab.sh"
2525
VERSION="1"
2626
LOG_FILE="n4a-autolab.log" # not used yet, but will be soon
27-
export MY_LOCATION=centralus # can be changed to your location
27+
if [ -z "$MY_LOCATION" ]; then
28+
export MY_LOCATION=centralus
29+
fi
30+
# export MY_LOCATION=centralus # can be changed to your location
2831

2932
# On OS X, you can pull your username. You can also set it yourself for use in the script:
3033
# export OWNER=<your name>

functions.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ function create_aks_cluster1(){
401401
export MY_AKS1=n4a-aks1
402402
export MY_AKS2=n4a-aks2
403403
export MY_NAME=${MY_NAME:-$(whoami)}
404-
export K8S_VERSION=1.29
404+
export K8S_VERSION=1.32
405+
export NIC_VERSION=v3.7.2
405406
export MY_SUBNET1=$(az network vnet subnet show -g $MY_RESOURCEGROUP -n aks1-subnet --vnet-name n4a-vnet --only-show-errors --query id -o tsv)
406407
export MY_SUBNET2=$(az network vnet subnet show -g $MY_RESOURCEGROUP -n aks2-subnet --vnet-name n4a-vnet --only-show-errors --query id -o tsv)
407408
# This requires that you place your JWT file in the labs/lab3 directory and name it nginx-repo.jwt
@@ -441,12 +442,12 @@ function clone_repo(){
441442

442443
if [ -d kubernetes-ingress/deployments ]; then
443444
EXISTS=1
444-
MESSAGE="Use Existing NGINX Ingress Controller Repo"
445+
MESSAGE="Use Existing NGINX Ingress Controller Repo version: $NIC_VERSION"
445446
LGTH=${#MESSAGE}
446447
else
447-
CLONE=`git clone https://github.com/nginxinc/kubernetes-ingress.git --branch v3.3.2`
448-
cd kubernetes-ingress/deployments
449-
MESSAGE="Cloning NGINX Ingress Controller Repo"
448+
CLONE=`git clone https://github.com/nginx/kubernetes-ingress.git --branch $NIC_VERSION`
449+
# cd kubernetes-ingress/deployments
450+
MESSAGE="Cloning NGINX Ingress Controller Repo version: $NIC_VERSION"
450451
LGTH=${#MESSAGE}
451452
fi
452453

@@ -471,11 +472,11 @@ kubectl apply -f kubernetes-ingress/deployments/rbac/rbac.yaml
471472
kubectl apply -f kubernetes-ingress/examples/shared-examples/default-server-secret/default-server-secret.yaml
472473
kubectl apply -f kubernetes-ingress/deployments/common/nginx-config.yaml
473474
kubectl apply -f kubernetes-ingress/deployments/common/ingress-class.yaml
474-
kubectl apply -f kubernetes-ingress/deployments/common/crds/k8s.nginx.org_virtualservers.yaml
475-
kubectl apply -f kubernetes-ingress/deployments/common/crds/k8s.nginx.org_virtualserverroutes.yaml
476-
kubectl apply -f kubernetes-ingress/deployments/common/crds/k8s.nginx.org_transportservers.yaml
477-
kubectl apply -f kubernetes-ingress/deployments/common/crds/k8s.nginx.org_policies.yaml
478-
kubectl apply -f kubernetes-ingress/deployments/common/crds/k8s.nginx.org_globalconfigurations.yaml`
475+
kubectl apply -f kubernetes-ingress/config/crd/bases/k8s.nginx.org_virtualservers.yaml
476+
kubectl apply -f kubernetes-ingress/config/crd/bases/k8s.nginx.org_virtualserverroutes.yaml
477+
kubectl apply -f kubernetes-ingress/config/crd/bases/k8s.nginx.org_transportservers.yaml
478+
kubectl apply -f kubernetes-ingress/config/crd/bases/k8s.nginx.org_policies.yaml
479+
kubectl apply -f kubernetes-ingress/config/crd/bases/k8s.nginx.org_globalconfigurations.yaml`
479480

480481
if [[ -z "$CREATE_NIC_RESOURCES1" ]]; then
481482
echo -ne $MESSAGE
@@ -579,11 +580,11 @@ kubectl apply -f kubernetes-ingress/deployments/rbac/rbac.yaml
579580
kubectl apply -f kubernetes-ingress/examples/shared-examples/default-server-secret/default-server-secret.yaml
580581
kubectl apply -f kubernetes-ingress/deployments/common/nginx-config.yaml
581582
kubectl apply -f kubernetes-ingress/deployments/common/ingress-class.yaml
582-
kubectl apply -f kubernetes-ingress/deployments/common/crds/k8s.nginx.org_virtualservers.yaml
583-
kubectl apply -f kubernetes-ingress/deployments/common/crds/k8s.nginx.org_virtualserverroutes.yaml
584-
kubectl apply -f kubernetes-ingress/deployments/common/crds/k8s.nginx.org_transportservers.yaml
585-
kubectl apply -f kubernetes-ingress/deployments/common/crds/k8s.nginx.org_policies.yaml
586-
kubectl apply -f kubernetes-ingress/deployments/common/crds/k8s.nginx.org_globalconfigurations.yaml`
583+
kubectl apply -f kubernetes-ingress/config/crd/bases/k8s.nginx.org_virtualservers.yaml
584+
kubectl apply -f kubernetes-ingress/config/crd/bases/k8s.nginx.org_virtualserverroutes.yaml
585+
kubectl apply -f kubernetes-ingress/config/crd/bases/k8s.nginx.org_transportservers.yaml
586+
kubectl apply -f kubernetes-ingress/config/crd/bases/k8s.nginx.org_policies.yaml
587+
kubectl apply -f kubernetes-ingress/config/crd/bases/k8s.nginx.org_globalconfigurations.yaml`
587588

588589
if [[ -z "$CREATE_NIC_RESOURCES2" ]]; then
589590
echo -ne $MESSAGE

labs/lab2/readme.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ For additional information on the script you can run the same command with `-h`
6363

6464
```bash
6565
## Set environment variables
66-
export MY_RESOURCEGROUP=s.dutta-workshop
66+
export MY_RESOURCEGROUP=${MY_NAME}-n4a-workshop
67+
export MY_ID=`az group show -n $MY_RESOURCEGROUP --query "id" -otsv`
6768
```
6869

6970
1. Make sure your Terminal is the `nginx-azure-workshops/labs` directory for all commands during this Workshop.
@@ -85,14 +86,19 @@ For additional information on the script you can run the same command with `-h`
8586
--assign-identity \
8687
--generate-ssh-keys \
8788
--public-ip-sku Standard \
88-
--custom-data lab2/init.sh
89+
--custom-data lab2/init.sh \
90+
--scope $MY_ID \
91+
--role Owner \
92+
--security-type TrustedLaunch \
93+
--enable-secure-boot true \
94+
--enable-vtpm true
8995
```
9096

9197
```bash
9298
##Sample Output##
9399
{
94100
"fqdns": "",
95-
"id": "/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/s.dutta-workshop/providers/Microsoft.Compute/virtualMachines/n4a-ubuntuvm",
101+
"id": "/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/sh.dutta-n4a-workshop/providers/Microsoft.Compute/virtualMachines/n4a-ubuntuvm",
96102
"identity": {
97103
"systemAssignedIdentity": "xxxx-xxxx-xxxx-xxxx-xxxx",
98104
"userAssignedIdentities": {}
@@ -102,7 +108,7 @@ For additional information on the script you can run the same command with `-h`
102108
"powerState": "VM running",
103109
"privateIpAddress": "172.16.2.4",
104110
"publicIpAddress": "<AZURE_ASSIGNED_PUBLICIP>",
105-
"resourceGroup": "s.dutta-workshop",
111+
"resourceGroup": "sh.dutta-n4a-workshop",
106112
"zones": ""
107113
}
108114
```
@@ -473,7 +479,7 @@ Similar to how you deployed an Ubuntu VM, you will now deploy a Windows VM.
473479
1. In your local machine open terminal and make sure you are logged onto your Azure tenant. Set the following Environment variables:
474480

475481
```bash
476-
export MY_RESOURCEGROUP=s.dutta-workshop
482+
export MY_RESOURCEGROUP=${MY_NAME}-n4a-workshop
477483
export MY_VM_IMAGE=cognosys:iis-on-windows-server-2016:iis-on-windows-server-2016:1.2019.1009
478484
```
479485

@@ -487,7 +493,8 @@ Similar to how you deployed an Ubuntu VM, you will now deploy a Windows VM.
487493
--vnet-name n4a-vnet \
488494
--subnet vm-subnet \
489495
--admin-username azureuser \
490-
--public-ip-sku Standard
496+
--public-ip-sku Standard \
497+
--security-type Standard
491498
```
492499

493500
```bash
@@ -497,13 +504,13 @@ Similar to how you deployed an Ubuntu VM, you will now deploy a Windows VM.
497504
Consider upgrading security for your workloads using Azure Trusted Launch VMs. To know more about Trusted Launch, please visit https://aka.ms/TrustedLaunch.
498505
{
499506
"fqdns": "",
500-
"id": "/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/s.dutta-workshop/providers/Microsoft.Compute/virtualMachines/n4a-windowsvm",
507+
"id": "/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/sh.dutta-n4a-workshop/providers/Microsoft.Compute/virtualMachines/n4a-windowsvm",
501508
"location": "centralus",
502509
"macAddress": "00-0D-3A-96-C5-F1",
503510
"powerState": "VM running",
504511
"privateIpAddress": "172.16.2.5",
505512
"publicIpAddress": "<AZURE_ASSIGNED_PUBLICIP>",
506-
"resourceGroup": "s.dutta-workshop",
513+
"resourceGroup": "sh.dutta-n4a-workshop",
507514
"zones": ""
508515
}
509516
```

labs/lab3/nginx-plus-ingress.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spec:
3535
# - name: nginx-log
3636
# emptyDir: {}
3737
containers:
38-
- image: private-registry.nginx.com/nginx-ic/nginx-plus-ingress:3.3.2
38+
- image: private-registry.nginx.com/nginx-ic/nginx-plus-ingress:3.7.2
3939
imagePullPolicy: IfNotPresent
4040
name: nginx-plus-ingress
4141
ports:
@@ -94,23 +94,23 @@ spec:
9494
args:
9595
- -nginx-plus
9696
- -nginx-configmaps=$(POD_NAMESPACE)/nginx-config
97-
- -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
9897
- -nginx-status-port=9000
9998
- -nginx-status-allow-cidrs=0.0.0.0/0
100-
#- -include-year
99+
- -report-ingress-status
100+
- -enable-oidc
101+
- -external-service=nginx-ingress
102+
- -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
101103
#- -enable-cert-manager
102104
#- -enable-external-dns
103105
#- -enable-app-protect
104106
#- -enable-app-protect-dos
105107
#- -v=3 # Enables extensive logging. Useful for troubleshooting.
106-
- -report-ingress-status
107-
#- -external-service=nginx-ingress
108108
- -enable-prometheus-metrics
109-
- -enable-oidc
109+
- -enable-latency-metrics
110110
#- -enable-service-insight
111111
- -global-configuration=$(POD_NAMESPACE)/nginx-configuration
112112
# initContainers:
113-
# - image: nginx/nginx-ingress:3.2.1
113+
# - image: nginx/nginx-ingress:3.7.2
114114
# imagePullPolicy: IfNotPresent
115115
# name: init-nginx-ingress
116116
# command: ['cp', '-vdR', '/etc/nginx/.', '/mnt/etc']

0 commit comments

Comments
 (0)