You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The getting started guide needs to change with the new NGF architecture, specifically regarding the NodePorts. The user no longer needs to create the Service, and instead specifies configuration at installation time.
The port value should equal the _containerPort_ value from _cluster-config.yaml_[when you created the kind cluster](#set-up-a-kind-cluster). The _listenerPort_ value will match the port that we expose in the Gateway listener.
Create the file _nodeport-config.yaml_ with the following contents:
136
-
137
-
```yaml {linenos=true, hl_lines=[20, 25]}
138
-
apiVersion: v1
139
-
kind: Service
140
-
metadata:
141
-
name: nginx-gateway
142
-
namespace: nginx-gateway
143
-
labels:
144
-
app.kubernetes.io/name: nginx-gateway-fabric
145
-
app.kubernetes.io/instance: ngf
146
-
app.kubernetes.io/version: "{{< version-ngf >}}"
147
-
spec:
148
-
type: NodePort
149
-
selector:
150
-
app.kubernetes.io/name: nginx-gateway-fabric
151
-
app.kubernetes.io/instance: ngf
152
-
ports:
153
-
- name: http
154
-
port: 80
155
-
protocol: TCP
156
-
targetPort: 80
157
-
nodePort: 31437
158
-
- name: https
159
-
port: 443
160
-
protocol: TCP
161
-
targetPort: 443
162
-
nodePort: 31438
163
-
```
164
-
165
-
{{< note >}}
166
-
The highlighted _nodePort_ values should equal the _containerPort_ values from _cluster-config.yaml_ [when you created the kind cluster](#set-up-a-kind-cluster).
167
-
{{< /note >}}
168
-
169
-
Apply it using `kubectl`:
170
-
171
-
```shell
172
-
kubectl apply -f nodeport-config.yaml
173
-
```
174
-
```text
175
-
service/nginx-gateway created
176
-
```
177
-
178
-
{{< warning >}}
179
-
The NodePort resource must be deployed in the same namespace as NGINX Gateway Fabric.
180
-
181
-
If you are making customizations, ensure your `labels:` and `selectors:` also match the labels of the NGINX Gateway Fabric deployment.
182
-
{{< /warning >}}
183
-
184
-
---
185
-
186
133
## Create an example application
187
134
188
135
In the previous section, you deployed NGINX Gateway Fabric to a local cluster. This section shows you how to deploy a simple web application to test that NGINX Gateway Fabric works.
You can also use `kubectl describe` on the new resources to check their status:
280
239
281
240
```shell
282
-
kubectl describe httproutes
241
+
kubectl -n default describe httproutes
283
242
```
284
243
285
244
```text
@@ -290,10 +249,10 @@ Annotations: <none>
290
249
API Version: gateway.networking.k8s.io/v1
291
250
Kind: HTTPRoute
292
251
Metadata:
293
-
Creation Timestamp: 2024-10-21T13:46:51Z
252
+
Creation Timestamp: 2025-04-29T19:06:31Z
294
253
Generation: 1
295
-
Resource Version: 821
296
-
UID: cc591089-d3aa-44d3-a851-e2bbfa285029
254
+
Resource Version: 12285
255
+
UID: c8055a74-b4c6-442f-b3fb-350fb88b2a7c
297
256
Spec:
298
257
Hostnames:
299
258
cafe.example.com
@@ -316,13 +275,13 @@ Spec:
316
275
Status:
317
276
Parents:
318
277
Conditions:
319
-
Last Transition Time: 2024-10-21T13:46:51Z
278
+
Last Transition Time: 2025-04-29T19:06:31Z
320
279
Message: The route is accepted
321
280
Observed Generation: 1
322
281
Reason: Accepted
323
282
Status: True
324
283
Type: Accepted
325
-
Last Transition Time: 2024-10-21T13:46:51Z
284
+
Last Transition Time: 2025-04-29T19:06:31Z
326
285
Message: All references are resolved
327
286
Observed Generation: 1
328
287
Reason: ResolvedRefs
@@ -345,10 +304,10 @@ Annotations: <none>
345
304
API Version: gateway.networking.k8s.io/v1
346
305
Kind: HTTPRoute
347
306
Metadata:
348
-
Creation Timestamp: 2024-10-21T13:46:51Z
307
+
Creation Timestamp: 2025-04-29T19:06:31Z
349
308
Generation: 1
350
-
Resource Version: 823
351
-
UID: d72d2a19-1c4d-48c4-9808-5678cff6c331
309
+
Resource Version: 12284
310
+
UID: 55aa0ab5-9b1c-4028-9bb5-4903f05bb998
352
311
Spec:
353
312
Hostnames:
354
313
cafe.example.com
@@ -371,13 +330,13 @@ Spec:
371
330
Status:
372
331
Parents:
373
332
Conditions:
374
-
Last Transition Time: 2024-10-21T13:46:51Z
333
+
Last Transition Time: 2025-04-29T19:06:31Z
375
334
Message: The route is accepted
376
335
Observed Generation: 1
377
336
Reason: Accepted
378
337
Status: True
379
338
Type: Accepted
380
-
Last Transition Time: 2024-10-21T13:46:51Z
339
+
Last Transition Time: 2025-04-29T19:06:31Z
381
340
Message: All references are resolved
382
341
Observed Generation: 1
383
342
Reason: ResolvedRefs
@@ -394,7 +353,7 @@ Events: <none>
394
353
```
395
354
396
355
```shell
397
-
kubectl describe gateways
356
+
kubectl -n default describe gateways
398
357
```
399
358
400
359
```text
@@ -405,10 +364,10 @@ Annotations: <none>
405
364
API Version: gateway.networking.k8s.io/v1
406
365
Kind: Gateway
407
366
Metadata:
408
-
Creation Timestamp: 2024-10-21T13:46:36Z
367
+
Creation Timestamp: 2025-04-29T19:05:01Z
409
368
Generation: 1
410
-
Resource Version: 824
411
-
UID: 2ae8ec42-70eb-41a4-b249-3e47177aea48
369
+
Resource Version: 12286
370
+
UID: 0baa6e15-55e0-405a-9e7c-de22472fc3ad
412
371
Spec:
413
372
Gateway Class Name: nginx
414
373
Listeners:
@@ -422,15 +381,15 @@ Spec:
422
381
Status:
423
382
Addresses:
424
383
Type: IPAddress
425
-
Value: 10.244.0.5
384
+
Value: 10.96.157.168
426
385
Conditions:
427
-
Last Transition Time: 2024-10-21T13:46:51Z
386
+
Last Transition Time: 2025-04-29T19:06:31Z
428
387
Message: Gateway is accepted
429
388
Observed Generation: 1
430
389
Reason: Accepted
431
390
Status: True
432
391
Type: Accepted
433
-
Last Transition Time: 2024-10-21T13:46:51Z
392
+
Last Transition Time: 2025-04-29T19:06:31Z
434
393
Message: Gateway is programmed
435
394
Observed Generation: 1
436
395
Reason: Programmed
@@ -439,25 +398,25 @@ Status:
439
398
Listeners:
440
399
Attached Routes: 2
441
400
Conditions:
442
-
Last Transition Time: 2024-10-21T13:46:51Z
401
+
Last Transition Time: 2025-04-29T19:06:31Z
443
402
Message: Listener is accepted
444
403
Observed Generation: 1
445
404
Reason: Accepted
446
405
Status: True
447
406
Type: Accepted
448
-
Last Transition Time: 2024-10-21T13:46:51Z
407
+
Last Transition Time: 2025-04-29T19:06:31Z
449
408
Message: Listener is programmed
450
409
Observed Generation: 1
451
410
Reason: Programmed
452
411
Status: True
453
412
Type: Programmed
454
-
Last Transition Time: 2024-10-21T13:46:51Z
413
+
Last Transition Time: 2025-04-29T19:06:31Z
455
414
Message: All references are resolved
456
415
Observed Generation: 1
457
416
Reason: ResolvedRefs
458
417
Status: True
459
418
Type: ResolvedRefs
460
-
Last Transition Time: 2024-10-21T13:46:51Z
419
+
Last Transition Time: 2025-04-29T19:06:31Z
461
420
Message: No conflicts
462
421
Observed Generation: 1
463
422
Reason: NoConflicts
@@ -476,7 +435,7 @@ Events: <none>
476
435
477
436
## Test NGINX Gateway Fabric
478
437
479
-
By configuring the cluster with the ports `31437` and `31438`, there is implicit port forwarding from your local machine to NodePort, allowing for direct communication to the NGINX Gateway Fabric service.
438
+
By configuring the cluster with the port`31437`, there is implicit port forwarding from your local machine to NodePort, allowing for direct communication to the NGINX Gateway Fabric service.
480
439
481
440
You can use `curl` to test the new services by targeting the hostname (_cafe.example.com_) with the _/coffee_ and _/tea_ paths:
0 commit comments