Skip to content

Commit 0d4206d

Browse files
authored
lab5 edits (#46)
* lab5 edits
1 parent 2b51f64 commit 0d4206d

File tree

1 file changed

+133
-128
lines changed

1 file changed

+133
-128
lines changed

labs/lab5/readme.md

+133-128
Original file line numberDiff line numberDiff line change
@@ -26,120 +26,119 @@ This lab will explore the R33 upgrade process with NGINX One Console. With relea
2626

2727
## Deploy a container running R33 with Docker
2828

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

3433
<br/>
3534

36-
### Deploy an R33 instance.
35+
### Deploy an R33 instance
3736

3837
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.
3938

40-
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:
39+
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:
4140

42-
```bash
43-
echo $JWT
44-
# If the result is empty, set it the JWT variable again.
45-
export JWT=$(cat license.jwt)
41+
```bash
42+
echo $JWT
43+
# If the result is empty, set it the JWT variable again.
44+
export JWT=$(cat lab5/license.jwt)
4645

47-
#Confirm the other two previously used variables are still set:
48-
echo $NAME
49-
echo $TOKEN
46+
#Confirm the other two previously used variables are still set:
47+
echo $NAME
48+
echo $TOKEN
5049

51-
# If they are not set, go ahead and set them again:
52-
export NAME=<YOUR_INITIALS.LASTNAME>
53-
export TOKEN=<insert the dataplane key for NGINX One Console that you used previously>
54-
```
50+
# If they are not set, go ahead and set them again:
51+
export NAME=<YOUR_INITIALS.LASTNAME>
52+
export TOKEN=<insert the dataplane key for NGINX One Console that you used previously>
53+
```
5554

56-
If you updated/changed the JWT token, you will need to login to docker again. Skip if everything was still set from before:
55+
1. If you updated/changed the JWT token, you will need to login to docker again. Skip if everything was still set from before:
5756

58-
```bash
59-
docker login private-registry.nginx.com --username=$JWT --password=none
60-
```
57+
```bash
58+
docker login private-registry.nginx.com --username=$JWT --password=none
59+
```
6160

62-
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.
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.
6362

64-
```bash
65-
vi lab5/docker-compose.yml
66-
```
63+
```bash
64+
vi lab5/docker-compose.yml
65+
```
6766

68-
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.
67+
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.
6968

70-
Starting on line 75 let's uncomment this block of code (ends on line 96):
69+
Starting on line 75 let's uncomment this block of code (ends on line 96):
7170
72-
```bash
73-
### Uncomment this section for Lab5
74-
plus4: # Debian R33 NGINX Plus Web / Load Balancer
75-
environment:
76-
NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com'
77-
NGINX_AGENT_SERVER_GRPCPORT: '443'
78-
NGINX_AGENT_TLS_ENABLE: 'true'
79-
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron NGINX One Console
80-
NGINX_LICENSE_JWT: $JWT
81-
NGINX_AGENT_INSTANCE_GROUP: $NAME-sync-group
82-
hostname: $NAME-plus4
83-
container_name: $NAME-plus4
84-
image: private-registry.nginx.com/nginx-plus/agent:debian # From NGINX Private Registry R33
85-
volumes: # Sync these folders to container
86-
- ./nginx-plus/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
87-
- ./nginx-plus/etc/nginx/conf.d:/etc/nginx/conf.d
88-
- ./nginx-plus/etc/nginx/includes:/etc/nginx/includes
89-
- ./nginx-plus/usr/share/nginx/html:/usr/share/nginx/html
90-
ports:
91-
- '80' # Open for HTTP
92-
- '443' # Open for HTTPS
93-
- '9000' # Open for API / Dashboard page
94-
- '9113' # Open for Prometheus Scraper page
95-
restart: always
96-
#
97-
```
71+
```bash
72+
### Uncomment this section for Lab5
73+
plus4: # Debian R33 NGINX Plus Web / Load Balancer
74+
environment:
75+
NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com'
76+
NGINX_AGENT_SERVER_GRPCPORT: '443'
77+
NGINX_AGENT_TLS_ENABLE: 'true'
78+
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron NGINX One Console
79+
NGINX_LICENSE_JWT: $JWT
80+
NGINX_AGENT_INSTANCE_GROUP: $NAME-sync-group
81+
hostname: $NAME-plus4
82+
container_name: $NAME-plus4
83+
image: private-registry.nginx.com/nginx-plus/agent:debian # From NGINX Private Registry R33
84+
volumes: # Sync these folders to container
85+
- ./nginx-plus/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
86+
- ./nginx-plus/etc/nginx/conf.d:/etc/nginx/conf.d
87+
- ./nginx-plus/etc/nginx/includes:/etc/nginx/includes
88+
- ./nginx-plus/usr/share/nginx/html:/usr/share/nginx/html
89+
ports:
90+
- '80' # Open for HTTP
91+
- '443' # Open for HTTPS
92+
- '9000' # Open for API / Dashboard page
93+
- '9113' # Open for Prometheus Scraper page
94+
restart: always
95+
#
96+
```
9897
99-
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.
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.
10099

101-
Now that this file is edited, save it and let's restart the containers. Issue the following commands:
100+
1. Now that this file is edited, save it and let's restart the containers. Issue the following commands:
102101
103-
```bash
104-
docker compose down
105-
docker compose up --force-recreate -d
106-
```
102+
```bash
103+
docker compose down
104+
docker compose up --force-recreate -d
105+
```
107106
108107
<br />
109108
110109
## Examine in NGINX One Console
111110
112-
You will notice a few things in NGINX One Console now. First - why are there duplicate container names?!?!?
111+
1. You will notice a few things in NGINX One Console now. First - why are there duplicate container names?!?!?
113112
114-
![NGINX Plus](media/r33-delete-old-instances-1.png)
113+
![NGINX Plus](media/r33-delete-old-instances-1.png)
115114
116-
Containers as you know are ephemeral. Once you destroy / recreate them they re-register with the Console. You can manually clean these up (delete the grayed out versions of your images) or you can have these cleaned up automatically. Previously you used the search to narrow down the instances with your name. This time you will use the Filter feature. Choose the action of `Availability is Unavailable` then you can select your containers and use the `Delete selected` button.
115+
1. Containers as you know are ephemeral. Once you destroy / recreate them they re-register with the Console. You can manually clean these up (delete the grayed out versions of your images) or you can have these cleaned up automatically. Previously you used the search to narrow down the instances with your name. This time you will use the Filter feature. Choose the action of `Availability is Unavailable` then you can select your containers and use the `Delete selected` button.
117116
118-
> **NOTE:** If you are in shared environment make sure you are deleting only your instances.
117+
> **NOTE:** If you are in shared environment make sure you are deleting only your instances.
119118
120-
![NGINX Plus](media/r33-delete-old-instances-2.png)
119+
![NGINX Plus](media/r33-delete-old-instances-2.png)
121120
122-
Once done, remember to clear the filter so you will be able to see the active instances.
121+
1. Once done, remember to clear the filter so you will be able to see the active instances.
123122
124-
![NGINX Plus](media/r33-delete-old-instances-3.png)
123+
![NGINX Plus](media/r33-delete-old-instances-3.png)
125124
126-
**(Optional Exercise)** To automate this removal of instances, you can expand the `Settings` menu on the left hand side it will reveal an entry for `Instance Settings`. (Requires Admin access)
125+
1. **(Optional Step):** To automate this removal of instances, you can expand the `Settings` menu on the left hand side it will reveal an entry for `Instance Settings`. (Requires Admin access. See [References](#references) for details)
127126
128-
![NGINX Plus](media/r33-instance-settings-1.png)
127+
![NGINX Plus](media/r33-instance-settings-1.png)
129128
130-
Clicking that will take you to a screen where you can change the cleanup to a time of your choosing. The default is at 24 hours, but you can set it down to a single hour.
129+
Clicking that will take you to a screen where you can change the cleanup to a time of your choosing. The default is at 24 hours, but you can set it down to a single hour.
131130
132-
![NGINX Plus](media/r33-instance-settings-2.png)
131+
![NGINX Plus](media/r33-instance-settings-2.png)
133132
134-
> **NOTE:** Make sure you aren't too aggressive with the auto cleanup as sometimes it is good to see what has been out in production over a recent period.
133+
> **NOTE:** Make sure you aren't too aggressive with the auto cleanup as sometimes it is good to see what has been out in production over a recent period.
135134

136-
Now that you have cleaned things up you can see the `plus4` instance in your `Instances` interface.
135+
1. Now that you have cleaned things up, you can see the `plus4` instance in your `Instances` interface.
137136

138-
![NGINX Plus](media/r33-plus4-deployed.png)
137+
![NGINX Plus](media/r33-plus4-deployed.png)
139138

140-
If you click on the `plus4` instance name, now you can see the NGINX version as well as the Agent version that are deployed:
139+
1. If you click on the `plus4` instance name, now you can see the NGINX version as well as the Agent version that are deployed:
141140

142-
![NGINX Plus](media/r33-plus4-with-agent.png)
141+
![NGINX Plus](media/r33-plus4-with-agent.png)
143142

144143
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.
145144
@@ -161,96 +160,102 @@ Don't forget to remove your unused Instances from the NGINX One Console.
161160

162161
## Install NGINX Plus R32 on a VM
163162

164-
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. From the VS Studio Terminal window, run the following commands.
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.
165164
166-
>**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).
165+
1. From the VS Studio Terminal window, run the following commands.
167166
168-
```bash
169-
ssh nplus
170-
cd ~/Documents
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).
171168
172-
sudo mkdir -p /etc/nginx/
173-
sudo cp license/license.jwt /etc/nginx/license.jwt
169+
```bash
170+
ssh nplus
171+
cd ~/Documents
174172
175-
sudo mkdir -p /etc/ssl/nginx
176-
sudo cp license/nginx-repo.* /etc/ssl/nginx/
177-
```
173+
sudo mkdir -p /etc/nginx/
174+
sudo cp license/license.jwt /etc/nginx/license.jwt
178175
179-
With the cert and key in place you can go ahead with the install. Let's do the pre-work:
176+
sudo mkdir -p /etc/ssl/nginx
177+
sudo cp license/nginx-repo.* /etc/ssl/nginx/
178+
```
180179
181-
```bash
182-
sudo apt update
183-
sudo apt install apt-transport-https lsb-release ca-certificates wget gnupg2 ubuntu-keyring
184-
wget -qO - https://cs.nginx.com/static/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
185-
printf "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
186-
https://pkgs.nginx.com/plus/ubuntu `lsb_release -cs` nginx-plus\n" | sudo tee /etc/apt/sources.list.d/nginx-plus.list
187-
```
180+
1. With the cert and key in place you can go ahead with the install. Let's do the pre-work:
188181

189-
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/`
182+
```bash
183+
sudo apt update
184+
sudo apt install apt-transport-https lsb-release ca-certificates wget gnupg2 ubuntu-keyring
185+
wget -qO - https://cs.nginx.com/static/keys/nginx_signing.key | gpg --dearmor | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
186+
printf "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
187+
https://pkgs.nginx.com/plus/ubuntu `lsb_release -cs` nginx-plus\n" | sudo tee /etc/apt/sources.list.d/nginx-plus.list
188+
```
190189

191-
```bash
192-
sudo vi /etc/apt/sources.list.d/nginx-plus.list
193-
```
190+
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/`
194191

195-
Change this line:
192+
```bash
193+
sudo vi /etc/apt/sources.list.d/nginx-plus.list
194+
```
196195

197-
```bash
198-
"https://pkgs.nginx.com/plus/ubuntu jammy nginx-plus"
196+
Change this line:
199197

200-
```
198+
```bash
199+
"https://pkgs.nginx.com/plus/ubuntu jammy nginx-plus"
201200
202-
to:
201+
```
203202

204-
```bash
205-
"https://pkgs.nginx.com/plus/R32/ubuntu jammy nginx-plus"
203+
to:
206204

207-
```
205+
```bash
206+
"https://pkgs.nginx.com/plus/R32/ubuntu jammy nginx-plus"
208207
209-
Run the commands to install NGINX Plus:
208+
```
210209

211-
```bash
212-
sudo wget -P /etc/apt/apt.conf.d https://cs.nginx.com/static/files/90pkgs-nginx
213-
sudo apt update
214-
sudo apt install -y nginx-plus
210+
1. Run the commands to install NGINX Plus:
215211

216-
```
212+
```bash
213+
sudo wget -P /etc/apt/apt.conf.d https://cs.nginx.com/static/files/90pkgs-nginx
214+
sudo apt update
215+
sudo apt install -y nginx-plus
217216
218-
Confirm the version that you installed:
217+
```
219218

220-
```bash
221-
nginx -v
219+
1. Confirm the version that you installed:
222220

223-
```
221+
```bash
222+
nginx -v
224223
225-
```bash
226-
### SAMPLE OUTPUT ###
227-
nginx version: nginx/1.25.5 (nginx-plus-r32-p2)
224+
```
228225

229-
```
226+
```bash
227+
### SAMPLE OUTPUT ###
228+
nginx version: nginx/1.25.5 (nginx-plus-r32-p2)
230229
231-
```bash
232-
sudo systemctl enable nginx
233-
sudo systemctl start nginx
230+
```
234231

235-
```
232+
1. Finally enable and start NGINX Plus
233+
234+
```bash
235+
sudo systemctl enable nginx
236+
sudo systemctl start nginx
237+
238+
```
236239

237240
<br/>
238241

239242
## Install NGINX Agent and add NGINX Plus VM to NGINX One Console
240243

241-
First, you will create a new Config Sync Group to add machines that you want to upgrade. As a best practice, you want your Config Sync Groups to only contain machines that will have the exact same configuration. For example, a group for docker containers with nginx. One for OSS instances you might have. Here you are creating a group to add Virtual Machines that you want to upgrade. Follow the same process as the previous lab by clicking on `Config Sync Groups` in the left hand menu and then clicking on the `Add Config Sync Group` button.
244+
First, you will create a new Config Sync Group to add machines that you want to upgrade. As a best practice, you want your Config Sync Groups to only contain machines that will have the exact same configuration. For example, a group for docker containers with NGINX. One for OSS instances you might have. Here you are creating a group to add Virtual Machines that you want to upgrade.
245+
246+
1. Follow the same process as the previous lab by clicking on `Config Sync Groups` in the left hand menu and then clicking on the `Add Config Sync Group` button.
242247

243-
![Add Config Sync Group](media/lab5-config-sync-group1.png)
248+
![Add Config Sync Group](media/lab5-config-sync-group1.png)
244249

245-
In the NGINX One Console, open your new Config Sync Group, click on the `Add Instance` button.
250+
1. In the NGINX One Console, open your new Config Sync Group, click on the `Add Instance` button.
246251

247-
![Add Instance](media/lab5-add-instance-1.png)
252+
![Add Instance](media/lab5-add-instance-1.png)
248253

249-
It will ask you if you want to `Generate a new key` or `Use existing key`. You have already created a TOKEN variable in previous labs so you will use that same value. Click on the radio button for `Use existing key`.
254+
1. It will ask you if you want to `Generate a new key` or `Use existing key`. You have already created a TOKEN variable in previous labs so you will use that same value. Click on the radio button for `Use existing key`.
250255

251-
![Add Instance to Sync Group](media/lab5-add-instance-csg.png)
256+
![Add Instance to Sync Group](media/lab5-add-instance-csg.png)
252257

253-
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.
258+
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.
254259

255260
1. If not already connected, use the VScode Terminal, SSH to the NGINX Plus VM.
256261

@@ -539,4 +544,4 @@ You can update a single instance following this procedure for adding a license.j
539544
540545
-------------
541546
542-
Navigate to [LabGuide](../readme.md))
547+
Navigate to ([LabGuide](../readme.md))

0 commit comments

Comments
 (0)