diff --git a/src/components/NavigationDocs.jsx b/src/components/NavigationDocs.jsx index 16b4de2e..f5b434ec 100644 --- a/src/components/NavigationDocs.jsx +++ b/src/components/NavigationDocs.jsx @@ -456,6 +456,7 @@ export const docsNavigation = [ isOpen: true, links: [ { title: 'Operator', href: '/manage/integrations/kubernetes' }, + { title: 'Gateway API beta', href: '/manage/integrations/kubernetes/gateway-api-beta' }, ], }, ], @@ -796,7 +797,7 @@ function NavigationGroup({ group, className, hasChildren }) { onClick={() => { setIsOpen(!isOpen) if (!isOpen) { - if (!isActiveGroup) router.push(group.links[0].href) + if (!isActiveGroup && group.links[0]?.href) router.push(group.links[0].href) setActiveHighlight() } else { setActiveHighlight(group.title) diff --git a/src/pages/manage/integrations/kubernetes/gateway-api-beta/index.mdx b/src/pages/manage/integrations/kubernetes/gateway-api-beta/index.mdx new file mode 100644 index 00000000..f26c0c96 --- /dev/null +++ b/src/pages/manage/integrations/kubernetes/gateway-api-beta/index.mdx @@ -0,0 +1,253 @@ +# Kubernetes Gateway API Integration + +The NetBird Kubernetes operator supports the [Gateway API](https://gateway-api.sigs.k8s.io/) as an alternative to annotation-based service exposure. Using standard Gateway API resources, you can: + +- **Expose services publicly** via reverse proxy using `HTTPRoute` resources with the public gateway class +- **Expose services privately** to your NetBird network using `TCPRoute` resources with the private gateway class + +The operator watches for these Gateway API resources and automatically creates the corresponding [Networks and Resources](/manage/networks) in your NetBird account. + +## Prerequisites + +Before you begin, ensure you have the following: + +- **Helm** version 3+ (recommended) +- **kubectl** version v1.11.3+ +- Access to a **Kubernetes** v1.11.3+ cluster +- **Cert Manager** (recommended) — for secure communication between the k8s API and the operator +- A **NetBird API token** — you can create a PAT by following the steps [here](/manage/public-api#creating-a-service-user) + +## Installation + +### Step 1: Add the Helm repository + +```shell +helm repo add netbirdio https://netbirdio.github.io/helms +``` + +### Step 2: Install Cert Manager + +This is recommended for the k8s API to communicate securely with the NetBird operator. + +```shell +kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.17.0/cert-manager.yaml +``` + +### Step 3: Install the Gateway API CRDs + +The operator requires the experimental Gateway API CRDs to be installed in your cluster. + +```shell +kubectl apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.5.0/experimental-install.yaml +``` + +### Step 4: Create the NetBird API secret + +Create a namespace for the operator and store your API token as a Kubernetes secret. + +```shell +kubectl create namespace netbird +kubectl -n netbird create secret generic netbird-mgmt-api-key --from-literal=NB_API_KEY=$(cat ~/nb-pat.secret) +``` + + + Replace `~/nb-pat.secret` with the path to your NetBird API key. + + +### Step 5: Install the operator + + + The operator version 0.3.0-rc.2 is subject to breaking changes. Values and behavior may change in future releases. + + +```shell +helm upgrade --install kubernetes-operator netbirdio/kubernetes-operator \ + --namespace netbird \ + --create-namespace \ + --version 0.3.0-rc.2 \ + -f - < + If using a custom hostname, make sure that the domain name is properly configured in your DNS settings. + + +The following example deploys a demo application and creates an `HTTPRoute` with a custom hostname pointing to the public gateway: + +```bash +export DEPLOYMENT_NAME=demo-nb-k8s; export DEPLOYMENT_IMAGE=ghcr.io/netbirdio/kubernetes-demo; cat < + + + +- Make sure to [star us on GitHub](https://github.com/netbirdio/netbird) +- Follow us [on X](https://x.com/netbird) +- Join our [Slack Channel](/slack-url) +- NetBird [latest release](https://github.com/netbirdio/netbird/releases) on GitHub diff --git a/src/pages/manage/integrations/kubernetes/index.mdx b/src/pages/manage/integrations/kubernetes/index.mdx index bc3a127b..2ed5c51e 100644 --- a/src/pages/manage/integrations/kubernetes/index.mdx +++ b/src/pages/manage/integrations/kubernetes/index.mdx @@ -25,10 +25,14 @@ helm repo add netbirdio https://netbirdio.github.io/helms ```shell kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.17.0/cert-manager.yaml ``` -3. Add NetBird API token. You can create a PAT by following the steps [here](/manage/public-api#creating-a-service-user). +3. Install the Gateway API CRDs. +```shell +kubectl apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.5.0/experimental-install.yaml +``` +4. Add NetBird API token. You can create a PAT by following the steps [here](/manage/public-api#creating-a-service-user). ```shell kubectl create namespace netbird -kubectl -n netbird create secret generic netbird-mgmt-api-key --from-literal=NB_API_KEY=$(cat ~/nb-pat.secret) +kubectl -n netbird create secret generic netbird-mgmt-api-key --from-literal=NB_API_KEY=nbp_iVkOxFHOpx5K3Gc7qMqwCTqBWkHRpH2KunpX ``` Replace `~/nb-pat.secret` with your NetBird API key.