Skip to content

Commit 299b975

Browse files
authored
Lab5 update (#51)
* Removing install of NGINX Plus in readme * Lab 5 updates for R34
1 parent 28b3efd commit 299b975

File tree

4 files changed

+44
-109
lines changed

4 files changed

+44
-109
lines changed

labs/lab5/docker-compose.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# NGINX Plus / OSS with NGINX Agent
22
# NGINX webservers with ingress-demo pages
33
# NGINX One Console Instance Registration
4-
# NGINX Basics, Dec 2024
54
# Chris Akker, Shouvik Dutta, Adam Currier
65
#
76
services:
@@ -72,7 +71,7 @@ services:
7271
restart: always
7372
#
7473
### Uncomment this section for Lab5
75-
# plus4: # Debian R33 NGINX Plus Web / Load Balancer
74+
# plus4: # Debian R34 NGINX Plus Web / Load Balancer
7675
# environment:
7776
# NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com'
7877
# NGINX_AGENT_SERVER_GRPCPORT: '443'
@@ -82,7 +81,7 @@ services:
8281
# NGINX_AGENT_INSTANCE_GROUP: $NAME-sync-group
8382
# hostname: $NAME-plus4
8483
# container_name: $NAME-plus4
85-
# image: private-registry.nginx.com/nginx-plus/agent:debian # From Nginx Private Registry R33
84+
# image: private-registry.nginx.com/nginx-plus/agent:debian # From Nginx Private Registry R34
8685
# volumes: # Sync these folders to container
8786
# - ./nginx-plus/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
8887
# - ./nginx-plus/etc/nginx/conf.d:/etc/nginx/conf.d
338 KB
Loading
-324 KB
Binary file not shown.

labs/lab5/readme.md

Lines changed: 42 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
# Upgrading NGINX Plus Instances to R33
1+
# Upgrading NGINX Plus Instances to R34
22

33
## Introduction
44

5-
This lab will explore the R33 upgrade process with NGINX One Console. With release 33, your instances being managed is now a requirement. Let's explore how you can add your instances to NGINX One Console and how it will assist us in prepping your systems for the R33 upgrade. You will explore the NGINX One Console interface, create an Instance Group and look at how you can manage configs. Finally, you will see deploying a R33 container instance to NGINX One Console and upgrading your standalone instance to R33 via NGINX One Console.
5+
This lab will explore the R33-R34 upgrade process with NGINX One Console. Starting with NGINX Plus Release 33, your instances being managed is now a requirement. Let's explore how you can add your instances to NGINX One Console and how it will assist us in prepping your systems for the upgrade. You will explore the NGINX One Console interface, create an Instance Group and look at how you can manage configs. Finally, you will see deploying a R34 container instance to NGINX One Console and upgrading your standalone instance to R34 via NGINX One Console.
66

77
## Learning Objectives
88

9-
- You will learn how to deploy a R33 version of a docker container
10-
- You will learn how to pin a release version while installing NGINX Plus
9+
- You will learn how to deploy a R34 version of a docker container
1110
- You will learn how to add an NGINX web server to NGINX One Console
1211
- You will learn how to install NGINX Agent
1312
- You will learn how to use Instance Groups to manage files
14-
- You will learn how to upgrade your release to R33 (latest)
13+
- You will learn how to upgrade your release to R34 (latest)
1514

1615
## Prerequisites
1716

@@ -24,17 +23,17 @@ This lab will explore the R33 upgrade process with NGINX One Console. With relea
2423

2524
<br/>
2625

27-
## Deploy a container running R33 with Docker
26+
## Deploy a container running R34 with Docker
2827

2928
| NGINX One Console | Docker | NGINX Plus |
3029
| :--------------------------------------: | :------------------------------: | :--------------------------------: |
3130
| ![NGINX One Console](media/nginx-one-icon.png) | ![Docker](media/docker-icon.png) | ![NGINX Plus](media/nginx-plus-icon.png) |
3231

3332
<br/>
3433

35-
### Deploy an R33 instance
34+
### Deploy an R34 instance
3635

37-
Release 33 of NGINX Plus now requires NGINX Agent to be installed along with a license for NGINX One (Not to be confused with the NGINX One Console you are working with today). It is not as painful as some have been led to believe. Let's add a new R33 instance to your lab setup.
36+
Starting with Release 33, NGINX Plus requires NGINX Agent to be installed along with a license for NGINX One (Not to be confused with the NGINX One Console you are working with today). It is not as painful as some have been led to believe. You will now add the latest version of an instance to your lab setup.
3837

3938
1. First you need the NGINX One `license.jwt` file which you can get from [my.f5.com](https://my.f5.com). Create a new file in the lab5 folder called `license.jwt` and paste the contents into it. If you are in the F5 UDF environment, this has been done for you. The $JWT environment variable should still be set from the earlier labs, but you can check it. If it is not there, add the license to an environment variable as you did previously:
4039

@@ -50,27 +49,30 @@ Release 33 of NGINX Plus now requires NGINX Agent to be installed along with a l
5049
# If they are not set, go ahead and set them again:
5150
export NAME=<YOUR_INITIALS.LASTNAME>
5251
export TOKEN=<insert the dataplane key for NGINX One Console that you used previously>
52+
5353
```
5454

5555
1. If you updated/changed the JWT token, you will need to login to docker again. Skip if everything was still set from before:
5656

5757
```bash
5858
docker login private-registry.nginx.com --username=$JWT --password=none
59+
5960
```
6061

61-
1. In this portion of the lab you will re-use a docker-compose.yml file from lab2 to deploy your containers and register with the NGINX One Console. This time you will now add an R33 (latest) version of the NGINX Plus container. Open the docker-compose file in VS Code.
62+
1. In this portion of the lab you will re-use a docker-compose.yml file from lab2 to deploy your containers and register with the NGINX One Console. This time you will now add an R34 (latest) version of the NGINX Plus container. Open the docker-compose file in VS Code.
6263

6364
```bash
6465
vi lab5/docker-compose.yml
66+
6567
```
6668

6769
After the `plus3` instance code block you will put a new block of code for the R33 release. You will call this `plus4`, keeping in line with your naming convention for the labs.
6870

69-
Starting on line 75 let's uncomment this block of code (ends on line 96):
71+
Starting on line 75 let's uncomment this block of code (ends on line 96). A little tip, in VS Studio you can highlight the block of code and press `Ctrl` + `/` to uncomment the whole block at once.
7072
7173
```bash
72-
### Uncomment this section for Lab5
73-
plus4: # Debian R33 NGINX Plus Web / Load Balancer
74+
### Uncomment the section below for Lab5
75+
plus4: # Debian R34 NGINX Plus Web / Load Balancer
7476
environment:
7577
NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com'
7678
NGINX_AGENT_SERVER_GRPCPORT: '443'
@@ -80,7 +82,7 @@ Release 33 of NGINX Plus now requires NGINX Agent to be installed along with a l
8082
NGINX_AGENT_INSTANCE_GROUP: $NAME-sync-group
8183
hostname: $NAME-plus4
8284
container_name: $NAME-plus4
83-
image: private-registry.nginx.com/nginx-plus/agent:debian # From NGINX Private Registry R33
85+
image: private-registry.nginx.com/nginx-plus/agent:debian # From NGINX Private Registry R34
8486
volumes: # Sync these folders to container
8587
- ./nginx-plus/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
8688
- ./nginx-plus/etc/nginx/conf.d:/etc/nginx/conf.d
@@ -93,15 +95,17 @@ Release 33 of NGINX Plus now requires NGINX Agent to be installed along with a l
9395
- '9113' # Open for Prometheus Scraper page
9496
restart: always
9597
#
98+
9699
```
97100
98-
1. Save your edits. You'll notice a couple of changes from the other blocks (besides the name). The first is the environment variable called `NGINX_LICENSE_JWT: $JWT` This is what authorizes the pulling of this specific image. The second change is the image name `private-registry.nginx.com/nginx-plus/agent:debian` which pulls the debian version of the NGINX Plus with Agent installed. You will be able to see this in the NGINX One Console once deployed.
101+
1. Save your edits. You'll notice a couple of changes from the other blocks (besides the name). The first is the environment variable called `NGINX_LICENSE_JWT: $JWT` This is what authorizes the pulling of this specific image. The second change is the image name `private-registry.nginx.com/nginx-plus/agent:debian` which pulls the latest Debian version of NGINX Plus with Agent installed. You will be able to see this in the NGINX One Console once deployed.
99102

100-
1. Now that this file is edited, save it and let's restart the containers. Issue the following commands:
103+
1. Now that this file is edited, restart the containers. Issue the following commands:
101104

102105
```bash
103106
docker compose down
104107
docker compose up --force-recreate -d
108+
105109
```
106110

107111
<br />
@@ -140,9 +144,9 @@ Release 33 of NGINX Plus now requires NGINX Agent to be installed along with a l
140144
141145
![NGINX Plus](media/r33-plus4-with-agent.png)
142146
143-
That's how easy it is to deploy an R33 instance and have it registered with NGINX One Console. Using A/B testing practices, you can move the traffic from any R31/32 container to the R33 instance.
147+
That's how easy it is to deploy an R34 instance and have it registered with NGINX One Console. Using A/B testing practices, you can move the traffic from any R31/32 container to the R33 instance.
144148

145-
>Notice that the `plus4, R33` container was ADDED to your <$NAME-sync-group>, (from your docker-compose file, line #82). This means it has the *SAME configuration* as the `plus1,2,3` containers. Because the configurations are synchronized, you can easily move traffic from older R31/R32 containers to newer R33 containers.
149+
>Notice that the `plus4, R34` container was ADDED to your <$NAME-sync-group>, (from your docker-compose file, line #82). This means it has the *SAME configuration* as the `plus1,2,3` containers. Because the configurations are synchronized, you can easily move traffic from older R31/R32 containers to newer R33/R34 containers.
146150

147151
>>This is a great way to upgrade and migrate your NGINX fleet to the latest versions of NGINX! After all the traffic has been routed to newer containers, you can safely delete older containers.
148152

@@ -152,64 +156,20 @@ When you are finished, you can now clean up your Docker environment by issuing:
152156

153157
```bash
154158
docker compose down
159+
155160
```
156161

157-
Don't forget to remove your unused Instances from the NGINX One Console.
162+
Don't forget to remove your unused instances from the NGINX One Console.
158163
159164
<br/>
160165
161-
## Install NGINX Plus R32 on a VM
162-
163-
Next you will create an NGINX instance that is pinned to version R32 on a virtual machine. This will show you an upgrade from R32 to the new R33 on a VM, a common NGINX upgrade task. From the Jumphost you can use the terminal to SSH to the VM's command line to do an install.
166+
## Confirm you have an R32 Instance
164167
165-
1. From the VS Studio Terminal window, run the following commands.
166-
167-
>**NOTE:** If you are using the F5 UDF environment, the NGINX Plus license files have been placed there ahead of time for your convenience. You can continue with the next step (install).
168+
You will now start the process of upgrading a standalone web server. Confirm taht you have this instance by issuing the following commands:
168169
170+
1. SSH to the web server:
169171
```bash
170172
ssh nplus
171-
cd ~/Documents
172-
173-
sudo mkdir -p /etc/ssl/nginx
174-
sudo cp license/nginx-repo.* /etc/ssl/nginx/
175-
```
176-
177-
1. With the cert and key in place you can go ahead with the install. Let's do the pre-work:
178-
179-
```bash
180-
sudo apt update
181-
sudo apt install apt-transport-https lsb-release ca-certificates wget gnupg2 ubuntu-keyring
182-
wget -qO - https://cs.nginx.com/static/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
183-
printf "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
184-
https://pkgs.nginx.com/plus/ubuntu `lsb_release -cs` nginx-plus\n" | sudo tee /etc/apt/sources.list.d/nginx-plus.list
185-
```
186-
187-
1. For this lab, you need to pin this release version to R32 so that you can see the upgrade process. The keys you are using are good for R33, so if you simply ask for an install of NGINX you will get the latest release (currently R33). To pin the release, you manually need to put the R32 branch in URL like: `/plus/R32/`
188-
189-
```bash
190-
sudo vi /etc/apt/sources.list.d/nginx-plus.list
191-
```
192-
193-
Change this line:
194-
195-
```bash
196-
"https://pkgs.nginx.com/plus/ubuntu jammy nginx-plus"
197-
198-
```
199-
200-
to:
201-
202-
```bash
203-
"https://pkgs.nginx.com/plus/R32/ubuntu jammy nginx-plus"
204-
205-
```
206-
207-
1. Run the commands to install NGINX Plus:
208-
209-
```bash
210-
sudo wget -P /etc/apt/apt.conf.d https://cs.nginx.com/static/files/90pkgs-nginx
211-
sudo apt update
212-
sudo apt install -y nginx-plus
213173
214174
```
215175
@@ -222,18 +182,10 @@ Next you will create an NGINX instance that is pinned to version R32 on a virtua
222182
223183
```bash
224184
### SAMPLE OUTPUT ###
225-
nginx version: nginx/1.25.5 (nginx-plus-r32-p2)
185+
nginx version: nginx/1.25.5 (nginx-plus-r32-p1)
226186
227187
```
228188
229-
1. Finally enable and start NGINX Plus
230-
231-
```bash
232-
sudo systemctl enable nginx
233-
sudo systemctl start nginx
234-
235-
```
236-
237189
<br/>
238190
239191
## Install NGINX Agent and add NGINX Plus VM to NGINX One Console
@@ -254,7 +206,7 @@ First, you will create a new Config Sync Group to add machines that you want to
254206
255207
1. In the field labeled `Data Plane Key (optional)`, type in the environment variable `$TOKEN`. This will customize the curl command. For this example, you will use `Virtual Machine or Bare Metal` tab. You will see the command to install agent and register the instance with NGINX One Console, and add it to your Sync Group.
256208
257-
1. If not already connected, use the VScode Terminal, SSH to the NGINX Plus VM.
209+
1. You should already be connected, but if not, use the VScode Terminal and SSH to the NGINX Plus VM.
258210
259211
```bash
260212
ssh nplus
@@ -270,10 +222,11 @@ First, you will create a new Config Sync Group to add machines that you want to
270222
271223
```
272224
273-
1. Set the hostname of your Ubuntu VM, so it displays in the NGINX One Console Instances. Use `Nginx123` for the password:
225+
1. Set the hostname of your Ubuntu VM, so it displays in the NGINX One Console Instances. Use `Nginx123` for the password:
274226
275227
```bash
276228
hostnamectl hostname $NAME-nplus-vm
229+
277230
```
278231
279232
```bash
@@ -286,7 +239,7 @@ First, you will create a new Config Sync Group to add machines that you want to
286239
287240
```
288241
289-
And verify it was set:
242+
Verify it was set:
290243
291244
```bash
292245
hostname
@@ -299,7 +252,7 @@ First, you will create a new Config Sync Group to add machines that you want to
299252
300253
```
301254
302-
1. Install the NGINX Agent and register with the NGINX One Console. You can copy/paste from the NGINX One Console, or use this example:
255+
1. Install the NGINX Agent and register with the NGINX One Console. You can copy/paste from the NGINX One Console, or use this example:
303256
304257
```bash
305258
curl https://agent.connect.nginx.com/nginx-agent/install | DATA_PLANE_KEY="$TOKEN" sh -s -- -y -c $NAME-sync-group-vm
@@ -370,7 +323,7 @@ Now that NGINX Agent is installed, configured for your Config Sync Group, the VM
370323
371324
## Enable NGINX Plus Dashboard and API
372325
373-
The NGINX Plus Dashboard and API is where NGINX exposes all of the over 240 metrics available. These include:
326+
The NGINX Plus Dashboard and API is where NGINX exposes all of the over 240 metrics available. These include:
374327
375328
- HTTP requests/responses
376329
- TLS session metrics
@@ -382,7 +335,7 @@ The NGINX Plus Dashboard and API is where NGINX exposes all of the over 240 metr
382335
- NGINX Worker metrics
383336
- And others
384337
385-
You can do this in the NGINX One Console - in the Config Sync Group, click on the Configuration tab, then Edit. Click the Add file button, and create `/etc/nginx/conf.d/dashboard.conf`. Use the example provide here, just copy/paste:
338+
You can do this in the NGINX One Console - in the Config Sync Group, click on the Configuration tab, then Edit. Click the Add file button, and create `/etc/nginx/conf.d/dashboard.conf`. Use the example provide here, just copy/paste:
386339
387340
```nginx
388341
# NGINX Plus Basics, Nov 2024
@@ -422,18 +375,19 @@ This configuration:
422375
423376
<br/>
424377
425-
## Upgrade NGINX Plus VM from R32 to R33
378+
## Upgrade NGINX Plus VM from R32 to R34
426379
427-
You have a system added to the Config Sync Group, let's show how you can push out config changes and **even new files**. To do an upgrade on an R32 system, there needs to be a `license.jwt` file placed in the `/etc/nginx` folder. This prevents accidental upgrades to R33 or later from happening. You will use the NGINX One Console to place the required R33 license file on each VM, so then you can go and upgrade each system.
380+
You have a system added to the Config Sync Group, let's show how you can push out config changes and **even new files**. To do an upgrade on an R32 system, there needs to be a `license.jwt` file placed in the `/etc/nginx` folder. This prevents accidental upgrades to R33 or later from happening. You will use the NGINX One Console to place the required R34 license file on each VM, so then you can go and upgrade each system.
428381
429-
Let's take the previous R32 install you just created and upgrade it. This time you will do it with assistance from NGINX One Console. On the `nplus` VM there is a directory for the NGINX One license files. The path is `~/Documents/license`.
382+
Let's take the R32 install and upgrade it. This time you will do it with assistance from NGINX One Console. On the `nplus` VM there is a directory for the NGINX One license files. The path is `~/Documents/license`.
430383
431384
1. In the UDF environment, the files are already there. From the jumphost, ssh to the `nplus` VM as you did earlier:
432385
433386
```bash
434387
ssh nplus
435388
cd Documents/
436389
tree license/
390+
437391
```
438392
439393
```bash
@@ -444,6 +398,7 @@ Let's take the previous R32 install you just created and upgrade it. This time y
444398
└── nginx-repo.key
445399
446400
0 directories, 3 files
401+
447402
```
448403
449404
1. In the NGINX One Console you will create a new file. Pull up the VM Config Sync Group - you can see there is one Instance (nplus) that is in the group.
@@ -474,26 +429,7 @@ Let's take the previous R32 install you just created and upgrade it. This time y
474429
475430
You can see the Console pushed out the new license file to the remote system. This can be a huge help in the upgrade process, as you can put 100's of instances into the Config Sync Group, then push the license.jwt file out to all of them automatically making them ready for an upgrade.
476431
477-
1. Let's go ahead and upgrade the instance as you are on the server already. For your example, you pinned the release to R32. When upgrading a system, you will not be sure if the system was pinned, so let's check:
478-
479-
```bash
480-
cd /etc/apt/sources.list.d/
481-
sudo vi nginx-plus.list
482-
```
483-
484-
This URL does contains R32, so it is pinned. Change this line:
485-
486-
```bash
487-
"https://pkgs.nginx.com/plus/R32/ubuntu jammy nginx-plus"
488-
```
489-
490-
to:
491-
492-
```bash
493-
"https://pkgs.nginx.com/plus/ubuntu jammy nginx-plus"
494-
```
495-
496-
1. Now you can do an upgrade:
432+
1. R32 is installed on the nplus server, and the NGINX repository is installed on the system. To upgrade, issue the following commands:
497433
498434
```bash
499435
sudo apt update
@@ -510,13 +446,13 @@ Let's take the previous R32 install you just created and upgrade it. This time y
510446
511447
```bash
512448
## Sample output ##
513-
nginx version: nginx/1.27.2 (nginx-plus-r33-p2)
449+
nginx version: nginx/1.27.4 (nginx-plus-r34)
514450
515451
```
516452
517453
1. NGINX Agent detected the NGINX upgrade and automatically send this information to NGINX One Console. You can also confirm this with NGINX One Console that the NGINX Plus version was upgraded for the VM. Click on the `Instances` menu on the left-hand side and you will see the instance was upgraded:
518454
519-
![NGINX Plus](media/lab5-upgrade-confirmed.png)
455+
![NGINX Plus](media/lab5-upgrade-confirmed-r34.png)
520456
521457
You can update a single instance following this procedure for adding a license.jwt to the server. However, using a Config Sync Group, you can prepare 100's or 1000's of instances in your NGINX fleet and have them ready for the upgrade.
522458

0 commit comments

Comments
 (0)