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
Copy file name to clipboardExpand all lines: site/content/installation/running-on-kind.md
+48-2
Original file line number
Diff line number
Diff line change
@@ -40,13 +40,59 @@ To install NGINX Gateway Fabric, choose the appropriate installation guide that
40
40
-[Installation with Helm]({{< relref "installation/installing-ngf/helm.md" >}})
41
41
-[Installation with Kubernetes manifests]({{< relref "installation/installing-ngf/manifests.md" >}})
42
42
43
+
## Set up a NodePort
44
+
45
+
When using kind clusters, be aware that NodePort services require [additional setup](https://kind.sigs.k8s.io/docs/user/configuration/#nodeport-with-port-mappings).
46
+
47
+
For example, the following will automatically set up port forwarding into a local cluster (intended for development):
48
+
49
+
```yaml
50
+
kind: Cluster
51
+
apiVersion: kind.x-k8s.io/v1alpha4
52
+
nodes:
53
+
- role: control-plane
54
+
extraPortMappings:
55
+
- containerPort: 31437
56
+
hostPort: 8080
57
+
protocol: TCP
58
+
- containerPort: 31438
59
+
hostPort: 8443
60
+
protocol: TCP
61
+
---
62
+
apiVersion: v1
63
+
kind: Service
64
+
metadata:
65
+
name: nginx-gateway
66
+
namespace: nginx-gateway # must be same namespace as your gateway
67
+
labels:
68
+
app.kubernetes.io/name: nginx-gateway
69
+
app.kubernetes.io/instance: nginx-gateway
70
+
app.kubernetes.io/version: "edge"
71
+
spec:
72
+
type: NodePort
73
+
selector:
74
+
app.kubernetes.io/name: nginx-gateway
75
+
app.kubernetes.io/instance: nginx-gateway
76
+
ports: # Update the following ports to match your Gateway Listener ports
77
+
- name: http
78
+
port: 80
79
+
protocol: TCP
80
+
targetPort: 80
81
+
nodePort: 31437# See https://kind.sigs.k8s.io/docs/user/configuration/#nodeport-with-port-mappings
82
+
- name: https
83
+
port: 443
84
+
protocol: TCP
85
+
targetPort: 443
86
+
nodePort: 31438
87
+
```
88
+
43
89
{{<note>}}
44
-
When using kind clusters, be aware that NodePort services require [additional setup](https://kind.sigs.k8s.io/docs/user/configuration/#nodeport-with-port-mappings). Also, for LoadBalancer services, you’ll need a [third-party controller](https://kind.sigs.k8s.io/docs/user/loadbalancer/) like MetalLB to assign external IPs. The default Helm chart creates a LoadBalancer service; however, you can disable this by adding `--set service.create=false` to your Helm command. Afterward, you can [configure port forwarding](#configure-port-forwarding) as described below to access the examples.
90
+
For LoadBalancer services, you’ll need a [third-party controller](https://kind.sigs.k8s.io/docs/user/loadbalancer/) like MetalLB to assign external IPs. The default Helm chart creates a LoadBalancer service; however, you can disable this by adding `--set service.create=false` to your Helm command. Afterward, you can [configure port forwarding](#configure-port-forwarding) as described below to access the examples.
45
91
{{</note>}}
46
92
47
93
## Configure Port Forwarding {#configure-port-forwarding}
48
94
49
-
Once NGINX Gateway Fabric has been installed, you need to configure port forwarding from local ports **8080** and **8443** to ports **80** and **443** on the **nginx-gateway** Pod.
95
+
Once NGINX Gateway Fabric has been installed, if you don't have port forwarding set with both the `NodePort` and `extraPortMappings`, you need to configure port forwarding from local ports **8080** and **8443** to ports **80** and **443** on the **nginx-gateway** Pod.
50
96
51
97
To configure port forwarding, run the following command:
0 commit comments