Skip to content

Commit a33fd5e

Browse files
committed
lab5 updates
1 parent 7c6f301 commit a33fd5e

File tree

1 file changed

+56
-43
lines changed

1 file changed

+56
-43
lines changed

labs/lab5/readme.md

Lines changed: 56 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -39,36 +39,40 @@ Starting with Release 33, NGINX Plus requires NGINX Agent to be installed along
3939

4040
```bash
4141
echo $JWT
42-
# If the result is empty, set it the JWT variable again.
43-
export JWT=$(cat lab5/license.jwt)
42+
```
43+
44+
If the result is empty, set it the JWT variable again.
45+
46+
```bash
47+
export JWT=$(cat ../lab2/license.jwt)
48+
```
4449

45-
#Confirm the other two previously used variables are still set:
50+
Confirm the other two previously used variables are still set:
51+
52+
```bash
4653
echo $NAME
4754
echo $TOKEN
55+
```
4856

49-
# If they are not set, go ahead and set them again:
57+
#If they are not set, go ahead and set them again:
58+
59+
```bash
5060
export NAME=<YOUR_INITIALS.LASTNAME>
5161
export TOKEN=<insert the dataplane key for NGINX One Console that you used previously>
52-
5362
```
5463

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:
64+
1. If you updated/changed the JWT token, you will need to login to Docker again. Skip if everything was still set from before:
5665

5766
```bash
5867
docker login private-registry.nginx.com --username=$JWT --password=none
5968
6069
```
6170

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.
63-
64-
```bash
65-
vi lab5/docker-compose.yml
66-
67-
```
71+
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.
6872

69-
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.
73+
After the `plus3` instance code block you will put a new block of code for the R34 release. You will call this `plus4`, keeping in line with your naming convention for the labs.
7074

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.
75+
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.
7276
7377
```bash
7478
### Uncomment the section below for Lab5
@@ -77,12 +81,12 @@ Starting with Release 33, NGINX Plus requires NGINX Agent to be installed along
7781
NGINX_AGENT_SERVER_HOST: 'agent.connect.nginx.com'
7882
NGINX_AGENT_SERVER_GRPCPORT: '443'
7983
NGINX_AGENT_TLS_ENABLE: 'true'
80-
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron NGINX One Console
84+
NGINX_AGENT_SERVER_TOKEN: $TOKEN # Datakey Fron NGINX One Console
8185
NGINX_LICENSE_JWT: $JWT
8286
NGINX_AGENT_INSTANCE_GROUP: $NAME-sync-group
8387
hostname: $NAME-plus4
8488
container_name: $NAME-plus4
85-
image: private-registry.nginx.com/nginx-plus/agent:debian # From NGINX Private Registry R34
89+
image: private-registry.nginx.com/nginx-plus/agent:debian # From NGINX Private Registry R34
8690
volumes: # Sync these folders to container
8791
- ./nginx-plus/etc/nginx/nginx.conf:/etc/nginx/nginx.conf
8892
- ./nginx-plus/etc/nginx/conf.d:/etc/nginx/conf.d
@@ -94,11 +98,12 @@ Starting with Release 33, NGINX Plus requires NGINX Agent to be installed along
9498
- '9000' # Open for API / Dashboard page
9599
- '9113' # Open for Prometheus Scraper page
96100
restart: always
97-
#
98101
99102
```
100103
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.
104+
1. Save your edits. You'll notice a couple of changes from the other blocks (besides the name).
105+
- The first is the environment variable called `NGINX_LICENSE_JWT: $JWT` This is what authorizes the pulling of this specific image.
106+
- The second change is the image name `private-registry.nginx.com/nginx-plus/agent:r34-debian` which pulls the R34 Debian version of NGINX Plus with Agent installed. You will be able to see this in the NGINX One Console once deployed.
102107

103108
1. Now that this file is edited, restart the containers. Issue the following commands:
104109

@@ -213,7 +218,7 @@ First, you will create a new Config Sync Group to add machines that you want to
213218
214219
```
215220
216-
1. Set your environment variables:
221+
1. Set your three environment variables, check them with `echo`:
217222
218223
```bash
219224
export NAME=<YOUR_INITIALS.LASTNAME>
@@ -222,6 +227,14 @@ First, you will create a new Config Sync Group to add machines that you want to
222227
223228
```
224229
230+
```bash
231+
echo $NAME
232+
echo $TOKEN
233+
echo $JWT
234+
235+
```
236+
237+
225238
1. Set the hostname of your Ubuntu VM, so it displays in the NGINX One Console Instances. Use `Nginx123` for the password:
226239
227240
```bash
@@ -337,32 +350,32 @@ The NGINX Plus Dashboard and API is where NGINX exposes all of the over 240 metr
337350
338351
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:
339352
340-
```nginx
341-
# NGINX Plus Basics, Nov 2024
342-
# Chris Akker, Shouvik Dutta, Adam Currier
343-
# dashboard.conf
344-
#
345-
server {
346-
# Conventional port for the NGINX Plus API is 8080
347-
listen 9000;
348-
access_log off; # reduce noise in access logs
349-
350-
location /api/ {
351-
# Enable in read-write mode
352-
api write=on;
353-
}
354-
# Conventional location of the NGINX Plus dashboard
355-
location = /dashboard.html {
356-
root /usr/share/nginx/html;
357-
}
358-
359-
# Redirect requests for "/" to "/dashboard.html"
360-
location / {
361-
return 301 /dashboard.html;
353+
```nginx
354+
# NGINX Plus Basics, Nov 2024
355+
# Chris Akker, Shouvik Dutta, Adam Currier
356+
# dashboard.conf
357+
#
358+
server {
359+
# Conventional port for the NGINX Plus API is 8080
360+
listen 9000;
361+
access_log off; # reduce noise in access logs
362+
363+
location /api/ {
364+
# Enable in read-write mode
365+
api write=on;
366+
}
367+
# Conventional location of the NGINX Plus dashboard
368+
location = /dashboard.html {
369+
root /usr/share/nginx/html;
370+
}
371+
372+
# Redirect requests for "/" to "/dashboard.html"
373+
location / {
374+
return 301 /dashboard.html;
375+
}
362376
}
363-
}
364377
365-
```
378+
```
366379
367380
![Add Dashboard.conf](media/lab5-add-dashboard.png)
368381

0 commit comments

Comments
 (0)