Files
netbird-kubernetes-operator/examples/gateway-api
Philip LaineandGitHub 59e0ee8daa Refactor Dockerfile to build Go binary outside of Docker (#218)
This change moves building the Go binary out of the Dockerfile, and also
fixes some issues in the makefile. These things will speed up build
times and avoid rebuilding when not needed. Additionally it will make
getting version data easier to use as part of the user agent.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
2026-05-04 14:44:10 +02:00
..

Gateway API

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.

make build-image
kind load docker-image docker.io/netbirdio/kubernetes-operator:dev

Install the Gateway API CRDs.

kubectl apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.5.0/experimental-install.yaml

Create Netbird namespace and API key secret.

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.

helm upgrade --install --create-namespace -f ./examples/gateway-api/values.yaml -n netbird netbird-operator ./helm/kubernetes-operator

Create the gateway along with the routing peer. This will deploy Netbird clients that route traffic into the cluster.

kubectl apply -f ./examples/gateway-api/gateway.yaml

Deploy the test Nginx application along with a HTTPRoute. The HTTPRoute will expose the service through Netbirds public proxy.

kubectl apply -f ./examples/gateway-api/nginx.yaml

Expose the Kubernetes API server service as a network resource in Netbird.

kubectl apply -f ./examples/gateway-api/kubernetes.yaml