Skip to content

Commit 700f6e8

Browse files
authored
CP/DP Split: Update documentation on accessing nginx container (#3338)
Update documentation on accessing nginx container Problem: With our incoming changes to our control data plane split, the nginx container will no longer be in the NGF Pod. Thus all documentation on accessing the nginx container (logs, sending traffic, config...) need to be updated. Solution: Updated the documentation. Mainly, when sending traffic in the examples, the host and IP of the NGINX Service are recorded after the Gateway is deployed. Most of these changes are in our examples.
1 parent 52da4cf commit 700f6e8

File tree

6 files changed

+65
-270
lines changed

6 files changed

+65
-270
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

0 commit comments

Comments
 (0)