Skip to content

Commit fa6260f

Browse files
Port lab 5 (#733)
* Ported lab 5
1 parent 7a90fb8 commit fa6260f

File tree

11 files changed

+266
-37
lines changed

11 files changed

+266
-37
lines changed

content/includes/config-snippets/enable-nplus-api-dashboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ server {
3434
root /usr/share/nginx/html;
3535
}
3636
}
37-
```
37+
```
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
docs:
3+
files:
4+
-
5+
-
6+
---
7+
8+
1. In the NGINX One Console, select **Manage > Config Sync Groups**, then pick your config sync group's name.
9+
2. Select the **Configuration** tab, then select **Edit Configuration**.
10+
3. Select **Add File**.
11+
4. Select **New Configuration File**.
12+
5. In the **File name** box, enter `/etc/nginx/conf.d/dashboard.conf`, then select **Add**.
13+
6. Paste the following into the new file workspace:
14+
15+
{{< include "config-snippets/enable-nplus-api-dashboard.md" >}}
16+
17+
7. Select **Next**, review the diff, then select **Save and Publish**.

content/includes/use-cases/monitoring/enable-nginx-plus-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ To collect comprehensive metrics for NGINX Plus, including bytes streamed, infor
1515
- To restrict write methods (`POST`, `PATCH`, `DELETE`), uncomment and configure the `limit_except GET` block and set up [HTTP basic authentication](https://nginx.org/en/docs/http/ngx_http_auth_basic_module.html).
1616
{{</ call-out >}}
1717

18-
For more details, see the [NGINX Plus API module](https://nginx.org/en/docs/http/ngx_http_api_module.html) documentation and [Configuring the NGINX Plus API]({{< ref "/nginx/admin-guide/monitoring/live-activity-monitoring.md#configuring-the-api" >}}).
18+
For more details, see the [NGINX Plus API module](https://nginx.org/en/docs/http/ngx_http_api_module.html) documentation and [Configuring the NGINX Plus API]({{< ref "/nginx/admin-guide/monitoring/live-activity-monitoring.md#configuring-the-api" >}}).
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/metrics/enable-metrics.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@ nd-product: NGINX-One
1414

1515
The NGINX One Console dashboard relies on APIs for NGINX Plus and NGINX Open Source Stub Status to report traffic and system metrics. The following sections show you how to enable those metrics.
1616

17-
### Enable NGINX Plus API
17+
## Enable NGINX Plus API and dashboard
1818

1919
{{< include "/use-cases/monitoring/enable-nginx-plus-api.md" >}}
2020

21-
### Enable NGINX Open Source Stub Status API
21+
## Enable NGINX Plus API and dashboard with Config Sync Groups
22+
23+
To enable the NGINX Plus API and dashboard with [Config Sync Groups]({{< ref "nginx-one/nginx-configs/config-sync-groups/manage-config-sync-groups.md" >}}), add a file named `/etc/nginx/conf.d/dashboard.conf` to your shared group config. Any instance you add to that group automatically uses those settings.
24+
25+
{{< include "use-cases/monitoring/enable-nginx-plus-api-with-config-sync-group.md" >}}
26+
27+
## Enable NGINX Open Source Stub Status API
2228

2329
{{< include "/use-cases/monitoring/enable-nginx-oss-stub-status.md" >}}

content/nginx-one/workshops/lab2/run-workshop-components-with-docker.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Make sure you have:
2828
- NGINX One service enabled in your XC account
2929
- Docker and Docker Compose installed and running
3030
- An active data plane key from [Lab 1: Get started with NGINX One Console]({{< ref "nginx-one/workshops/lab1/getting-started-with-nginx-one.md" >}})
31-
- A trial or paid NGINX Plus JWT license (saved as `nginx-repo.jwt`) from [MyF5](https://my.f5.com/manage/s/).
31+
- A trial or paid NGINX One JWT license (saved as `nginx-repo.jwt`) from [MyF5](https://my.f5.com/manage/s/).
3232
- Basic Linux and NGINX know-how
3333
- Git installed and SSH key set up for GitHub access
3434

@@ -48,9 +48,9 @@ Make sure you have:
4848
cd static/workshops/nginx-one/lab2
4949
```
5050

51-
This folder contains `docker-compose.yml` and `generate_certs.sh`.
51+
This folder contains `compose.yaml` and `generate_certs.sh`.
5252

53-
{{<fa "download">}} {{<link "/workshops/nginx-one/lab2/docker-compose.yml" "Download docker-compose.yaml">}}
53+
{{<fa "download">}} {{<link "/workshops/nginx-one/lab2/compose.yaml" "Download compose.yaml">}}
5454

5555
{{<fa "download">}} {{<link "/workshops/nginx-one/lab2/generate_certs.sh" "Download generate_certs.sh">}}
5656

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: 2 additions & 19 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
---
@@ -134,7 +117,7 @@ You can edit the `docker-config.yaml` file to add those instances to the config
134117
docker compose down
135118
```
136119

137-
2. Open `docker-compose.yaml` in a text editor.
120+
2. Open `compose.yaml` in a text editor.
138121
3. Uncomment the lines beginning with:
139122

140123
```yaml
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
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 trial or paid NGINX One JWT license (saved as `nginx-repo.jwt`) from [MyF5](https://my.f5.com/manage/s/).
37+
- A VM with NGINX Plus R32 (or earlier), SSH access, and the NGINX Agent installed (for VM scenario)
38+
- {{< include "workshops/nginx-one-env-variables.md" >}}
39+
- Basic familiarity with Linux command line and NGINX concepts
40+
41+
## Scenario A: Upgrade NGINX Plus in Docker
42+
43+
### Exercise A1: Pull and run the latest NGINX Plus image
44+
45+
1. In your shell, log in to the private registry:
46+
47+
```shell
48+
echo "$JWT" | docker login private-registry.nginx.com \
49+
--username "$JWT" --password-stdin
50+
```
51+
52+
2. Open `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.
53+
54+
```yaml
55+
plus4: # Debian latest NGINX Plus Web / Load Balancer
56+
environment:
57+
NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com'
58+
NGINX_AGENT_SERVER_GRPCPORT: '443'
59+
NGINX_AGENT_TLS_ENABLE: 'true'
60+
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Data plane key from NGINX One Console
61+
NGINX_LICENSE_JWT: $JWT
62+
NGINX_AGENT_INSTANCE_GROUP: $NAME-sync-group
63+
hostname: $NAME-plus4
64+
container_name: $NAME-plus4
65+
image: private-registry.nginx.com/nginx-plus/agent:debian # From NGINX Private Registry
66+
volumes: # Sync these folders to container
67+
- ./nginx-plus/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
68+
- ./nginx-plus/etc/nginx/conf.d:/etc/nginx/conf.d
69+
- ./nginx-plus/etc/nginx/includes:/etc/nginx/includes
70+
- ./nginx-plus/usr/share/nginx/html:/usr/share/nginx/html
71+
ports:
72+
- '80' # Open for HTTP
73+
- '443' # Open for HTTPS
74+
- '9000' # Open for API / Dashboard page
75+
- '9113' # Open for Prometheus Scraper page
76+
restart: always
77+
```
78+
79+
{{< call-out "note" "Tip" "" >}} If you use VS Code, highlight lines 74–95 and press `Ctrl` + `/` to uncomment them. {{< /call-out >}}
80+
81+
3. Restart your containers:
82+
83+
```shell
84+
docker compose down && docker compose up --force-recreate -d
85+
```
86+
87+
4. In the NGINX One Console, go to **Instances**.
88+
5. You should see your new instance (`$NAME-plus4`) in the list (for example, `s.jobs-plus4`).
89+
6. Select that instance and verify it runs the latest versions of NGINX Plus and NGINX Agent.
90+
7. The `$NAME-plus4` container was added to the `$NAME-sync-group` config sync group and inherited the shared config.
91+
92+
{{< 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 >}}
93+
94+
### Exercise A2: Delete unavailable containers
95+
96+
When you recreate containers, they re-register in the NGINX One Console. Use the filter to clean up old entries:
97+
98+
1. In the NGINX One Console, go **Instances**.
99+
2. Select **Add filter > Availability > Unavailable**.
100+
3. Check the boxes next to the unavailable hosts.
101+
4. Select **Delete selected**, then confirm.
102+
5. Remove the filter: Hover over the **Availability is Unavailable** filter tag, then select **X** to clear it and show all instances again.
103+
104+
<span style="display: inline-block;">
105+
{{< img src="nginx-one/images/unavailable-instances.png"
106+
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." >}}
107+
</span>
108+
109+
## Scenario B: Use Config Sync Groups to upgrade NGINX Plus on a VM
110+
111+
{{< call-out "note" "Note" >}}
112+
These steps cover RHEL, Amazon Linux, CentOS, Oracle Linux, AlmaLinux, Rocky Linux, Debian, and Ubuntu only. Other systems (for example, FreeBSD) aren’t covered here.
113+
{{</ call-out >}}
114+
115+
### Exercise B1: Create a Config Sync Group for VMs
116+
117+
1. In the NGINX One Console, go to **Manage > Config Sync Groups**.
118+
2. Select **Add Config Sync Group**.
119+
3. In the **Name** field, enter `$NAME-sync-group-vm` (for example, `s.jobs-sync-group-vm`), then select **Create**.
120+
121+
### Exercise B2: Add your VM to the Config Sync Group
122+
123+
1. Select **Manage > Config Sync Groups**, then pick your config sync group's name.
124+
2. On the **Details** tab, in the **Instances** pane, select **Add Instance to Config Sync Group**.
125+
3. Select **Register a new instance with NGINX One then add to config sync group**, then select **Next**.
126+
4. Select **Use existing key**, paste `<your-key>` into the **Data Plane Key** box.
127+
5. Copy the pre-filled `curl` command and run it on your VM:
128+
129+
**Example**:
130+
131+
```shell
132+
curl https://agent.connect.nginx.com/nginx-agent/install | \
133+
DATA_PLANE_KEY="<your-key>" \
134+
sh -s -- -y -c "<config-sync-group-name>"
135+
```
136+
137+
6. Back in the NGINX One Console, select **Refresh**. Your VM appears in the list and its **Config Sync Status** shows **In Sync**.
138+
139+
### Exercise B3: Enable the NGINX Plus API and dashboard
140+
141+
In this exercise, you add a new configuration file (`/etc/nginx/conf.d/dashboard.conf`) to your shared group config. This file enables the NGINX Plus API and dashboard. Any instance you add to the group will pick up these settings automatically.
142+
143+
{{< include "use-cases/monitoring/enable-nginx-plus-api-with-config-sync-group.md" >}}
144+
145+
### Exercise B4: Add your JWT license file
146+
147+
You need your NGINX One JWT license (from [MyF5](https://my.f5.com/manage/s/)) on each instance before you upgrade to the latest NGINX Plus. You can add it in your Config Sync Group so every member gets it automatically.
148+
149+
1. In the NGINX One Console, select **Manage > Config Sync Groups**, then pick your config sync group's name.
150+
2. Select the **Configuration** tab, then **Edit Configuration**.
151+
3. Select **Add File**.
152+
4. Select **New Configuration File**.
153+
5. In the **File name** box, enter `/etc/nginx/license.jwt` (the filename must match exactly), then select **Add**.
154+
6. Paste the contents of your JWT file into new file workspace.
155+
7. Select **Next**, review the diff, then select **Save and Publish**.
156+
157+
For more information, see [About subscription licenses]({{< ref "solutions/about-subscription-licenses.md" >}}).
158+
159+
### Exercise B5: Upgrade NGINX Plus on your VM
160+
161+
1. Upgrade the NGINX Plus package on your VM:
162+
163+
- **RHEL, Amazon Linux, CentOS, Oracle Linux, AlmaLinux, Rocky Linux**
164+
165+
```shell
166+
sudo yum upgrade nginx-plus
167+
```
168+
169+
- **Debian, Ubuntu**
170+
171+
```shell
172+
sudo apt update && sudo apt install nginx-plus
173+
```
174+
175+
2. In the NGINX One Console, go to **Manage > Instances**.
176+
3. Select your VM instance in the list.
177+
4. In the Instance Details panel, confirm the NGINX Plus version has been updated.
178+
5. If the version doesn’t update right away, refresh the page after a few seconds.
Loading

0 commit comments

Comments
 (0)