Share NBResource between different routes (#149)

This changes the behavior of the Netbird resource so that they can be
shared between routes rather than having one unique created per route.
This is important as we may want to have different route types pointing
to the same service.

Signed-off-by: Philip Laine <philip.laine@gmail.com>
This commit is contained in:
Philip Laine
2026-03-19 18:28:35 +01:00
committed by GitHub
parent e83dc472e2
commit 39ab189fae
9 changed files with 250 additions and 156 deletions
+39
View File
@@ -0,0 +1,39 @@
# Gateway API (Public)
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
kubectl apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.5.0/standard-install.yaml
```
Create Netbird namespace and API key secret.
```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
helm upgrade --install --create-namespace -f ./examples/gateway-api-public/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.
```shell
kubectl apply -f ./examples/gateway-api-public/gateway.yaml
```
Deploy the test Nginx application along with a HTTPRoute. The HTTPRoute will expose the service through Netbirds public proxy.
```shell
kubectl apply -f ./examples/gateway-api-public/nginx.yaml
```