2026-03-23 09:59:48 +01:00
# Gateway API
2026-03-19 18:28:35 +01:00
This example walks you through how to setup a Netbird Gateway API and expose Nginx through the Netbird proxy service.
Build image locally and load it into Kind.
```shell
make docker-build IMG = docker.io/netbirdio/kubernetes-operator:dev
kind load docker-image docker.io/netbirdio/kubernetes-operator:dev
```
Install the Gateway API CRDs.
```shell
2026-03-23 09:59:48 +01:00
kubectl apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.5.0/experimental-install.yaml
2026-03-19 18:28:35 +01:00
```
Create Netbird namespace and API key secret.
2026-03-23 09:59:48 +01:00
2026-03-19 18:28:35 +01:00
```shell
kubectl create namespace netbird
kubectl -n netbird create secret generic netbird-mgmt-api-key --from-literal NB_API_KEY = ${ NETBIRD_API_KEY }
```
Install the Kubernetes Operator. Make sure to use the customized values to enable Gateway API support. This assumes you have already created a secret containing a Netbird API key.
```shell
2026-03-23 09:59:48 +01:00
helm upgrade --install --create-namespace -f ./examples/gateway-api/values.yaml -n netbird netbird-operator ./helm/kubernetes-operator
2026-03-19 18:28:35 +01:00
```
Create the gateway along with the routing peer. This will deploy Netbird clients that route traffic into the cluster.
```shell
2026-03-23 09:59:48 +01:00
kubectl apply -f ./examples/gateway-api/gateway.yaml
2026-03-19 18:28:35 +01:00
```
Deploy the test Nginx application along with a HTTPRoute. The HTTPRoute will expose the service through Netbirds public proxy.
```shell
2026-03-23 09:59:48 +01:00
kubectl apply -f ./examples/gateway-api/nginx.yaml
```
Expose the Kubernetes API server service as a network resource in Netbird.
```shell
kubectl apply -f ./examples/gateway-api/kubernetes.yaml
2026-03-19 18:28:35 +01:00
```