Skip to content

Commit a3d6796

Browse files
committed
Update documentation on accessing nginx container
1 parent 52da4cf commit a3d6796

File tree

6 files changed

+73
-70
lines changed

6 files changed

+73
-70
lines changed

docs/developer/testing.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,19 @@ Follow the steps below for manual testing:
6969
- Logs of the `nginx-gateway` container. Look out for unexpected error logs or panics.
7070

7171
```shell
72-
kubectl logs -n nginx-gateway -l app=nginx-gateway
72+
kubectl -n nginx-gateway logs <ngf-pod-name> -c nginx-gateway
7373
```
7474

7575
- Logs of the `nginx` container. Look for unexpected error logs and verify the access logs are correct.
7676

7777
```shell
78-
kubectl logs -n nginx-gateway -l app=nginx
78+
kubectl -n <nginx-pod-namespace> logs <nginx-pod-name> -c nginx
7979
```
8080

8181
- The generated nginx config. Make sure it's correct.
8282
8383
```shell
84-
kubectl exec -it -n nginx-gateway <nginx gateway pod> -c nginx -- nginx -T
84+
kubectl exec -it -n <nginx-pod-namespace> <nginx-pod-name> -c nginx -- nginx -T
8585
```
8686
8787
- The statuses of the Gateway API Resources. Make sure they look correct.

examples/cafe-example/README.md

+9-12
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ to route traffic to that application using HTTPRoute resources.
99

1010
1. Follow the [installation instructions](https://docs.nginx.com/nginx-gateway-fabric/installation/) to deploy NGINX Gateway Fabric.
1111

12-
1. Save the public IP address of NGINX Gateway Fabric into a shell variable:
13-
14-
```text
15-
GW_IP=XXX.YYY.ZZZ.III
16-
```
17-
18-
1. Save the port of NGINX Gateway Fabric:
19-
20-
```text
21-
GW_PORT=<port number>
22-
```
23-
2412
## 2. Deploy the Cafe Application
2513

2614
1. Create the coffee and the tea Deployments and Services:
@@ -49,6 +37,15 @@ to route traffic to that application using HTTPRoute resources.
4937
kubectl apply -f gateway.yaml
5038
```
5139

40+
After creating the Gateway resource, NGINX Gateway Fabric will provision an NGINX Pod and Service fronting it to route traffic.
41+
42+
Save the public IP address and port of the NGINX Service into shell variables:
43+
44+
```text
45+
GW_IP=XXX.YYY.ZZZ.III
46+
GW_PORT=<port number>
47+
```
48+
5249
1. Create the HTTPRoute resources:
5350
5451
```shell

examples/cross-namespace-routing/README.md

+9-12
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ in a different namespace from our HTTPRoutes.
99

1010
1. Follow the [installation instructions](https://docs.nginx.com/nginx-gateway-fabric/installation/) to deploy NGINX Gateway Fabric.
1111

12-
1. Save the public IP address of NGINX Gateway Fabric into a shell variable:
13-
14-
```text
15-
GW_IP=XXX.YYY.ZZZ.III
16-
```
17-
18-
1. Save the port of NGINX Gateway Fabric:
19-
20-
```text
21-
GW_PORT=<port number>
22-
```
23-
2412
## 2. Deploy the Cafe Application
2513

2614
1. Create the cafe namespace and cafe application:
@@ -49,6 +37,15 @@ in a different namespace from our HTTPRoutes.
4937
kubectl apply -f gateway.yaml
5038
```
5139

40+
After creating the Gateway resource, NGINX Gateway Fabric will provision an NGINX Pod and Service fronting it to route traffic.
41+
42+
Save the public IP address and port of the NGINX Service into shell variables:
43+
44+
```text
45+
GW_IP=XXX.YYY.ZZZ.III
46+
GW_PORT=<port number>
47+
```
48+
5249
1. Create the HTTPRoute resources:
5350
5451
```shell

examples/grpc-routing/README.md

+33-18
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ to route traffic to that application using GRPCRoute resources.
99

1010
1. Follow the [installation instructions](https://docs.nginx.com/nginx-gateway-fabric/installation/) to deploy NGINX Gateway Fabric.
1111

12-
1. Save the public IP address of NGINX Gateway Fabric into a shell variable:
13-
14-
```text
15-
GW_IP=XXX.YYY.ZZZ.III
16-
```
17-
18-
1. Save the port of NGINX Gateway Fabric:
19-
20-
```text
21-
GW_PORT=<port number>
22-
```
23-
2412
## 2. Deploy the Helloworld Application
2513

2614
1. Create the two helloworld Deployments and Services:
@@ -60,7 +48,16 @@ There are 3 options to configure gRPC routing. To access the application and tes
6048
kubectl apply -f exact-method.yaml
6149
```
6250

63-
2. Test the Application:
51+
After creating the Gateway resource, NGINX Gateway Fabric will provision an NGINX Pod and Service fronting it to route traffic.
52+
53+
Save the public IP address and port of the NGINX Service into shell variables:
54+
55+
```text
56+
GW_IP=XXX.YYY.ZZZ.III
57+
GW_PORT=<port number>
58+
```
59+
60+
1. Test the Application:
6461

6562
```shell
6663
grpcurl -plaintext -proto grpc.proto -authority bar.com -d '{"name": "exact"}' ${GW_IP}:${GW_PORT} helloworld.Greeter/SayHello
@@ -72,7 +69,7 @@ There are 3 options to configure gRPC routing. To access the application and tes
7269
}
7370
```
7471

75-
3. Clean up the Gateway and GRPCRoute resources:
72+
1. Clean up the Gateway and GRPCRoute resources:
7673

7774
```shell
7875
kubectl delete -f exact-method.yaml
@@ -86,7 +83,16 @@ There are 3 options to configure gRPC routing. To access the application and tes
8683
kubectl apply -f hostname.yaml
8784
```
8885

89-
2. Test the Application:
86+
After creating the Gateway resource, NGINX Gateway Fabric will provision an NGINX Pod and Service fronting it to route traffic.
87+
88+
Save the public IP address and port of the NGINX Service into shell variables:
89+
90+
```text
91+
GW_IP=XXX.YYY.ZZZ.III
92+
GW_PORT=<port number>
93+
```
94+
95+
1. Test the Application:
9096

9197
```shell
9298
grpcurl -plaintext -proto grpc.proto -authority bar.com -d '{"name": "bar server"}' ${GW_IP}:${GW_PORT} helloworld.Greeter/SayHello
@@ -132,7 +138,7 @@ There are 3 options to configure gRPC routing. To access the application and tes
132138
2024/04/29 09:29:46 Received: foo bar server
133139
```
134140

135-
3. Clean up the Gateway and GRPCRoute resources:
141+
1. Clean up the Gateway and GRPCRoute resources:
136142

137143
```shell
138144
kubectl delete -f hostname.yaml
@@ -146,7 +152,16 @@ There are 3 options to configure gRPC routing. To access the application and tes
146152
kubectl apply -f headers.yaml
147153
```
148154

149-
2. Test the Application:
155+
After creating the Gateway resource, NGINX Gateway Fabric will provision an NGINX Pod and Service fronting it to route traffic.
156+
157+
Save the public IP address and port of the NGINX Service into shell variables:
158+
159+
```text
160+
GW_IP=XXX.YYY.ZZZ.III
161+
GW_PORT=<port number>
162+
```
163+
164+
1. Test the Application:
150165

151166
```shell
152167
grpcurl -plaintext -proto grpc.proto -authority bar.com -d '{"name": "version one"}' -H 'version: one' ${GW_IP}:${GW_PORT} helloworld.Greeter/SayHello
@@ -230,7 +245,7 @@ There are 3 options to configure gRPC routing. To access the application and tes
230245
2024/04/29 09:33:26 Received: version two orange
231246
```
232247

233-
3. Clean up the Gateway and GRPCRoute resources:
248+
1. Clean up the Gateway and GRPCRoute resources:
234249

235250
```shell
236251
kubectl delete -f headers.yaml

examples/https-termination/README.md

+10-13
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,6 @@ reference a Secret in a different Namespace.
1010

1111
1. Follow the [installation instructions](https://docs.nginx.com/nginx-gateway-fabric/installation/) to deploy NGINX Gateway Fabric.
1212

13-
1. Save the public IP address of NGINX Gateway Fabric into a shell variable:
14-
15-
```text
16-
GW_IP=XXX.YYY.ZZZ.III
17-
```
18-
19-
1. Save the ports of NGINX Gateway Fabric:
20-
21-
```text
22-
GW_HTTP_PORT=<http port number>
23-
GW_HTTPS_PORT=<https port number>
24-
```
25-
2613
## 2. Deploy the Cafe Application
2714

2815
1. Create the coffee and the tea Deployments and Services:
@@ -73,6 +60,16 @@ reference a Secret in a different Namespace.
7360
- `http` listener for HTTP traffic
7461
- `https` listener for HTTPS traffic. It terminates TLS connections using the `cafe-secret` we created in step 1.
7562

63+
After creating the Gateway resource, NGINX Gateway Fabric will provision an NGINX Pod and Service fronting it to route traffic.
64+
65+
Save the public IP address and ports of the NGINX Service into shell variables:
66+
67+
```text
68+
GW_IP=XXX.YYY.ZZZ.III
69+
GW_HTTP_PORT=<http port number>
70+
GW_HTTPS_PORT=<https port number>
71+
```
72+
7673
1. Create the HTTPRoute resources:
7774
7875
```shell

examples/traffic-splitting/README.md

+9-12
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@ and `coffee-v2`.
1111

1212
1. Follow the [installation instructions](https://docs.nginx.com/nginx-gateway-fabric/installation/) to deploy NGINX Gateway Fabric.
1313

14-
1. Save the public IP address of NGINX Gateway Fabric into a shell variable:
15-
16-
```text
17-
GW_IP=XXX.YYY.ZZZ.III
18-
```
19-
20-
1. Save the port of NGINX Gateway Fabric:
21-
22-
```text
23-
GW_PORT=<port number>
24-
```
25-
2614
## 2. Deploy the Coffee Application
2715

2816
1. Create the Cafe Deployments and Services:
@@ -51,6 +39,15 @@ and `coffee-v2`.
5139
kubectl apply -f gateway.yaml
5240
```
5341

42+
After creating the Gateway resource, NGINX Gateway Fabric will provision an NGINX Pod and Service fronting it to route traffic.
43+
44+
Save the public IP address and port of the NGINX Service into shell variables:
45+
46+
```text
47+
GW_IP=XXX.YYY.ZZZ.III
48+
GW_PORT=<port number>
49+
```
50+
5451
1. Create the HTTPRoute resources:
5552
5653
```shell

0 commit comments

Comments
 (0)