Skip to content

Commit 3f501e7

Browse files
committed
Ported lab 5
1 parent 8c8580e commit 3f501e7

File tree

6 files changed

+163
-29
lines changed

6 files changed

+163
-29
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
docs:
3+
files:
4+
- content/nginx-one/workshops/lab4/config-sync-groups.md
5+
- content/nginx-one/workshops/lab5/upgrade-nginx-plus-to-r34.md
6+
7+
---
8+
9+
Set these environment variables:
10+
11+
- **TOKEN**: your data plane key, for example:
12+
13+
```shell
14+
export TOKEN="your-data-plane-key"
15+
```
16+
17+
- **JWT**: your NGINX Plus license JWT. Save it as `nginx-repo.jwt`, then run:
18+
19+
```shell
20+
export JWT=$(cat path/to/nginx-repo.jwt)
21+
```
22+
23+
- **NAME**: a unique ID for your workshop (for example, `s.jobs`):
24+
25+
```shell
26+
export NAME="s.jobs"
27+
```

content/nginx-one/workshops/lab3/explore-nginx-one-console-and-features.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ Make sure you have:
3434

3535
- An F5 Distributed Cloud (XC) account with NGINX One enabled
3636
- All containers from [Lab 2](nginx-one/workshops/lab2/run-workshop-components-with-docker.md) running and registered
37-
- Your unique identifier in the `NAME` environment variable (set in Lab 2), for example `s.jobs`:
38-
39-
```shell
40-
export NAME="s.jobs"
41-
```
42-
37+
- {{< include "workshops/nginx-one-env-variables.md" >}}
4338
- Basic NGINX and Linux knowledge
4439

4540
---

content/nginx-one/workshops/lab4/config-sync-groups.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,7 @@ Make sure you have:
2424

2525
- Completed [Lab 2: Run workshop components with Docker]({{< ref "nginx-one/workshops/lab2/run-workshop-components-with-docker.md" >}})
2626
- Docker and Docker Compose installed and running
27-
- Your data plane key in the `TOKEN` environment variable (set in Lab 2):
28-
29-
```shell
30-
export TOKEN="your-data-plane-key"
31-
```
32-
33-
- Your NGINX Plus JWT license file saved as `nginx-repo.jwt`, and `JWT` set (set in Lab 2):
34-
35-
```shell
36-
export JWT=$(cat path/to/nginx-repo.jwt)
37-
```
38-
39-
- Your unique identifier in the NAME environment variable (set in Lab 2), for example `s.jobs`:
40-
41-
```shell
42-
export NAME="s.jobs"
43-
```
44-
27+
- {{< include "workshops/nginx-one-env-variables.md" >}}
4528
- Basic familiarity with Linux command line and NGINX concepts
4629

4730
---
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
title: "Lab 5: Upgrade NGINX Plus to the latest version"
3+
weight: 500
4+
toc: true
5+
nd-content-type: tutorial
6+
nd-product:
7+
- nginx-one
8+
- nginx-plus
9+
---
10+
11+
## Overview
12+
13+
In this lab, you upgrade NGINX Plus from R32 (or earlier) to the latest version in two ways:
14+
15+
- **Docker**: Deploy a new container running the latest NGINX Plus image, add it to your Config Sync Group, then shift traffic and retire older containers.
16+
- **VM**: Push your JWT license to an existing VM instance, install the new NGINX Plus package, and restart the service.
17+
18+
Pick the scenario that matches your setup.
19+
20+
## What you’ll learn
21+
22+
By the end of this lab, you’ll know how to:
23+
24+
- Deploy a Docker container running the latest NGINX Plus with NGINX Agent installed
25+
- Add a VM to a Config Sync Group and push your JWT license
26+
- Install or upgrade to the latest NGINX Plus on a VM
27+
- Check version and sync status in the NGINX One Console
28+
- Clean up unavailable instances in the NGINX One Console
29+
30+
## Before you begin
31+
32+
Make sure you have:
33+
34+
- Completed [Lab 4: Config Sync Groups]({{< ref "nginx-one/workshops/lab4/config-sync-groups.md" >}})
35+
- Docker and Docker Compose installed and running (for Docker scenario)
36+
- A VM with NGINX Plus R32 (or earlier), SSH access, and the NGINX Agent installed (for VM scenario)
37+
- {{< include "workshops/nginx-one-env-variables.md" >}}
38+
- Basic familiarity with Linux command line and NGINX concepts
39+
40+
## Scenario A: Upgrade NGINX Plus in Docker
41+
42+
### Exercise A1: Pull and run the latest NGINX Plus image
43+
44+
1. In your shell, log in to the private registry:
45+
46+
```shell
47+
echo "$JWT" | docker login private-registry.nginx.com \
48+
--username "$JWT" --password-stdin
49+
```
50+
51+
2. Open `docker-compose.yaml` in a text editor and uncomment the **plus4** service block (lines 74–95). This block pulls the latest Debian NGINX Plus image with the latest NGINX Agent installed, and sets your data plane key, JWT, and config sync group.
52+
53+
```yaml
54+
plus4: # Debian latest NGINX Plus Web / Load Balancer
55+
environment:
56+
NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com'
57+
NGINX_AGENT_SERVER_GRPCPORT: '443'
58+
NGINX_AGENT_TLS_ENABLE: 'true'
59+
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Data plane key from NGINX One Console
60+
NGINX_LICENSE_JWT: $JWT
61+
NGINX_AGENT_INSTANCE_GROUP: $NAME-sync-group
62+
hostname: $NAME-plus4
63+
container_name: $NAME-plus4
64+
image: private-registry.nginx.com/nginx-plus/agent:debian # From NGINX Private Registry
65+
volumes: # Sync these folders to container
66+
- ./nginx-plus/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
67+
- ./nginx-plus/etc/nginx/conf.d:/etc/nginx/conf.d
68+
- ./nginx-plus/etc/nginx/includes:/etc/nginx/includes
69+
- ./nginx-plus/usr/share/nginx/html:/usr/share/nginx/html
70+
ports:
71+
- '80' # Open for HTTP
72+
- '443' # Open for HTTPS
73+
- '9000' # Open for API / Dashboard page
74+
- '9113' # Open for Prometheus Scraper page
75+
restart: always
76+
```
77+
78+
{{< call-out "note" "Tip" "" >}} If you use VS Code, highlight lines 74–95 and press `Ctrl` + `/` to uncomment them. {{< /call-out >}}
79+
80+
3. Restart your containers:
81+
82+
```shell
83+
docker compose down && docker compose up --force-recreate -d
84+
```
85+
86+
4. In the NGINX One Console, go to **Instances**.
87+
5. You should see your new instance (`$NAME-plus4`) in the list (for example, `s.jobs-plus4`).
88+
6. Select that instance and verify it runs the latest versions of NGINX Plus and NGINX Agent.
89+
7. The `$NAME-plus4` container was added to the `$NAME-sync-group` config sync group and inherited the shared config.
90+
91+
{{< call-out "note" "Tip" "" >}} Because new containers in a sync group automatically pick up the shared config, you get a consistent, tested setup across versions. You can shift traffic to the new container one at a time for a safer, zero-downtime upgrade, and avoid any manual copy-and-paste steps. {{< /call-out >}}
92+
93+
### Exercise A2: Delete unavailable containers
94+
95+
When you recreate containers, they re-register in the NGINX One Console. Use the filter to clean up old entries:
96+
97+
1. In the NGINX One Console, go **Instances**.
98+
2. Select **Add filter > Availability > Unavailable**.
99+
3. Check the boxes next to the unavailable hosts.
100+
4. Select **Delete selected**, then confirm.
101+
5. Remove the filter: Hover over the **Availability is Unavailable** filter tag, then select **X** to clear it and show all instances again.
102+
103+
<span style="display: inline-block;">
104+
{{< img src="nginx-one/images/unavailable-instances.png"
105+
alt="Table of three NGINX One Console instances filtered to ‘Availability = Unavailable.’ Shows hostnames (s.jobs-plus1, s.jobs-plus2, s.jobs-plus3), NGINX versions, grey ‘Unavailable’ circles, CVE and recommendation indicators, certificate status, operating system, and last reported times. The ‘Delete selected’ button appears at top right." >}}
106+
</span>
Loading

static/workshops/nginx-one/lab2/docker-compose.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ services:
3232
NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com'
3333
NGINX_AGENT_SERVER_GRPCPORT: '443'
3434
NGINX_AGENT_TLS_ENABLE: 'true'
35-
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron Nginx One Console
35+
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Data plane key from NGINX One Console
3636
# NGINX_AGENT_INSTANCE_GROUP: $NAME-sync-group
3737
hostname: $NAME-plus2
3838
container_name: $NAME-plus2
@@ -54,7 +54,7 @@ services:
5454
NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com'
5555
NGINX_AGENT_SERVER_GRPCPORT: '443'
5656
NGINX_AGENT_TLS_ENABLE: 'true'
57-
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron Nginx One Console
57+
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Data plane key from NGINX One Console
5858
# NGINX_AGENT_INSTANCE_GROUP: $NAME-sync-group
5959
hostname: $NAME-plus3
6060
container_name: $NAME-plus3
@@ -71,12 +71,35 @@ services:
7171
- '9113' # Open for Prometheus Scraper page
7272
restart: always
7373
#
74+
# plus4: # Debian R34 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 # Data plane key from 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 R34
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+
#
7497
oss1: # Debian NGINX OSS Web / Load Balancer
7598
environment:
7699
NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com'
77100
NGINX_AGENT_SERVER_GRPCPORT: '443'
78101
NGINX_AGENT_TLS_ENABLE: 'true'
79-
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron Nginx One Console
102+
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Data plane key from NGINX One Console
80103
hostname: $NAME-oss1
81104
container_name: $NAME-oss1
82105
image: docker-registry.nginx.com/nginx/agent:mainline # From Docker Public Registry
@@ -98,7 +121,7 @@ services:
98121
NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com'
99122
NGINX_AGENT_SERVER_GRPCPORT: '443'
100123
NGINX_AGENT_TLS_ENABLE: 'true'
101-
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron Nginx One Console
124+
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Data plane key from NGINX One Console
102125
hostname: $NAME-oss2
103126
container_name: $NAME-oss2
104127
image: docker-registry.nginx.com/nginx/agent:alpine # From Docker Public Registry
@@ -120,7 +143,7 @@ services:
120143
NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com'
121144
NGINX_AGENT_SERVER_GRPCPORT: '443'
122145
NGINX_AGENT_TLS_ENABLE: 'true'
123-
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron Nginx One Console
146+
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Data plane key from NGINX One Console
124147
hostname: $NAME-oss3
125148
container_name: $NAME-oss3
126149
image: docker-registry.nginx.com/nginx/agent:1.26-alpine # From Docker Public Registry

0 commit comments

Comments
 (0)