netbird-reverse-proxy

by christianhuth

Helm chartv0.2.1App 0.72.4Verified publisher

A Helm chart for deploying the NetBird Reverse Proxy, which provides HTTP and HTTPS reverse proxy functionality for NetBird-managed services.

About this chart

netbird-reverse-proxy

A Helm chart for deploying the NetBird Reverse Proxy, which provides HTTP and HTTPS reverse proxy functionality for NetBird-managed services.

TL;DR;

helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/netbird-reverse-proxy

Or install it from the OCI registry:

helm install my-release oci://ghcr.io/christianhuth/helm-charts/netbird-reverse-proxy

Introduction

This chart bootstraps the NetBird Reverse Proxy on a Kubernetes cluster using the Helm package manager.

The NetBird Reverse Proxy provides reverse proxy functionality for NetBird-managed services. It always terminates TLS itself - it cannot run behind a load balancer or Gateway that terminates TLS and forwards plain HTTP to it. See the Architecture section before choosing how to expose it and where its certificate comes from.

Prerequisites

  • Kubernetes 1.19+
  • A NetBird management server - either NetBird Cloud, or your own self-hosted instance (which needs a couple of extra considerations, see Connecting to a self-hosted management server)
  • A proxy token (proxy.managementServer.auth.token), generated via netbird-server token create (or your management server's equivalent)
  • A domain name pointed at wherever this chart's Service ends up (proxy.domain)

The default certificate source (proxy.tls.source=selfSigned) has no further prerequisites - it's meant for getting started quickly, not for production with real external clients. For production, you'll also need either cert-manager (proxy.tls.source=secret) or just a public DNS record and an internet-reachable proxy (proxy.tls.source=acme, no cert-manager needed) - see Usage Scenarios and Certificate source.

Installing the Chart

To install the chart with the release name my-release:

helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/netbird-reverse-proxy \
  --set proxy.managementServer.address="https://my-netbird-management.example.com" \
  --set proxy.domain="my-proxy.example.com" \
  --set proxy.managementServer.auth.token="my-proxy-token"

The chart is also published as an OCI artifact which can be installed like this:

helm install my-release oci://ghcr.io/christianhuth/helm-charts/netbird-reverse-proxy \
  --set proxy.managementServer.address="https://my-netbird-management.example.com" \
  --set proxy.domain="my-proxy.example.com" \
  --set proxy.managementServer.auth.token="my-proxy-token"

This installs the chart in its default configuration: a LoadBalancer Service and a self-signed TLS certificate generated by the chart itself, requiring no other prerequisites. This default is fine for testing, but not for a production setup with real external clients - see Architecture for switching to a cert-manager-issued or ACME certificate. The Values section lists the values that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall the my-release deployment:

helm uninstall my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Usage Scenarios

Quick recipes for common setups. Each builds on the previous one - see Architecture for the reasoning behind each value if you want it.

Just evaluating the chart - see Installing the Chart above. The defaults (proxy.tls.source=selfSigned, service.type=LoadBalancer) need nothing beyond a token and a domain.

Production, using NetBird Cloud - leave proxy.managementServer.address unset (it defaults to NetBird Cloud), and switch to a real certificate source. acme is the simpler option since it needs no cert-manager dependency:

proxy:
  domain: "my-proxy.example.com"
  managementServer:
    auth:
      token: "my-proxy-token" # or auth.existingSecret, see below
  tls:
    source: acme

persistence:
  enabled: true
  storageClassName: "my-storage-class"

Prefer cert-manager instead? Set proxy.tls.source: secret with a wildcard Certificate (*.my-proxy.example.com) instead of the tls/persistence block above - see Certificate source for why it needs to be a wildcard.

Production, using a self-hosted management server - same as above, plus point proxy.managementServer.address at it:

proxy:
  domain: "my-proxy.example.com"
  managementServer:
    address: "https://netbird-grpc.example.com"
    auth:
      token: "my-proxy-token"
  tls:
    source: acme

persistence:
  enabled: true
  storageClassName: "my-storage-class"

If that management server sits behind a Gateway API GRPCRoute (or Traefik, or any other gRPC-aware router), double check it routes management.ProxyService in addition to the services a "normal" NetBird deployment needs - this is the single most common thing that breaks here, and the proxy's pod will simply stay at 0/1 Ready with no obvious error if it's missing. See Connecting to a self-hosted management server for the exact symptom and fix.

Architecture

Why this proxy can't sit behind a normal Ingress

The NetBird Reverse Proxy always terminates TLS itself for client-facing traffic - there is no plain-HTTP listener it can fall back to. This rules out a standard Kubernetes Ingress or a Gateway API HTTPRoute attached to an HTTPS listener, because both terminate TLS before forwarding the request, and would hand the proxy decrypted HTTP it cannot process. NetBird's own self-hosted docs call this out explicitly: they require Traefik configured for TLS passthrough in front of the proxy, specifically because passthrough forwards the raw, still-encrypted TLS bytes based on the SNI hostname alone, leaving the proxy to do the actual termination.

A plain Kubernetes Service (ClusterIP, NodePort, or LoadBalancer) never terminates TLS - it only ever forwards TCP - so it is passthrough by definition and needs no special configuration. This is why this chart's default exposure is a LoadBalancer Service rather than an Ingress.

There are therefore two independent choices to make: where the certificate comes from, and how the proxy is reached from outside the cluster.

Connecting to a self-hosted management server: proxy.managementServer.address

If your NetBird management server is self-hosted and sits behind a gRPC-aware router or gateway (Traefik, a Gateway API GRPCRoute, etc.), that router needs to route three gRPC services to the management backend, not just the two a "normal" NetBird deployment needs:

  • signalexchange.SignalExchange
  • management.ManagementService
  • management.ProxyService - used specifically for the proxy's connection to the management server, and easy to miss because regular NetBird clients (desktop/mobile apps, agents) never call it - only this reverse proxy does.

If management.ProxyService isn't routed, the proxy's pod will stay stuck at 0/1 Ready and its logs will repeat:

management connection failed, retrying in ...: mapping stream: receive msg: rpc error: code = Unimplemented desc =

That Unimplemented with an empty description is the router (Envoy, Traefik, etc.) rejecting a gRPC method it has no route for - the management server itself does implement management.ProxyService, it's just not reachable. For a Gateway API GRPCRoute, add a third rule alongside the existing two, pointing at the same backend:

rules:
  - backendRefs:
      - name: netbird-server-grpc # whatever your management gRPC Service is named
        port: 80
    matches:
      - method:
          service: management.ProxyService
          type: Exact

Why proxy.address defaults to :8443, not :443

The proxy's container image runs as a non-root user, and binding a port below 1024 (like 443) as non-root requires the NET_BIND_SERVICE capability - which may not be grantable on every cluster (some admission policies or sandboxed runtimes block it even when correctly requested). To avoid that dependency entirely, proxy.address defaults to the binary's own non-privileged default, :8443. This only changes where the proxy listens inside the container - service.https.port still defaults to the conventional 443 externally: the Service's https port has a named targetPort that always points at whatever port proxy.address resolves to, so clients still connect to https://your-domain with no port suffix needed.

This also holds for ACME's tls-alpn-01 challenge (proxy.tls.source=acme, see below): the CA only needs port 443 to be reachable on your public IP, and the Service already forwards external 443 to proxy.address internally - so the non-privileged default works there too, with no need to bind a privileged port directly. If you do need the container to bind a privileged port itself for some other reason, set proxy.address to a privileged port and add the NET_BIND_SERVICE capability under securityContext.capabilities.add.

proxy.private: NetBird-Only services

proxy.private (NB_PROXY_PRIVATE) advertises this proxy cluster's support for "NetBird-Only" private services - an opt-in, per-service access-control feature you enable per-service in the NetBird UI/API, not a network-exposure setting. Most deployments don't need it, so it defaults to false. Enabling it makes the proxy additionally set up a hardcoded :80/:443 listener pair for such services, regardless of what proxy.address is set to - so if you enable it, both of those ports need to be bindable (see the NET_BIND_SERVICE note above). The chart automatically adds the http (80) Service and container port whenever proxy.private=true or ACME http-01 (below) is in use - in every other configuration nothing listens on port 80, so the chart omits it entirely.

Certificate source: proxy.tls.source

Before choosing a source, it matters what you're actually securing: services you expose through the NetBird UI/API each get their own auto-generated, UUID-prefixed subdomain under proxy.domain (e.g. <uuid>.my-proxy.example.com) - clients reach that hostname, not proxy.domain itself. proxy.domain only needs its own valid certificate if you expose a service at the bare domain too.

selfSigned (default) - the chart generates a self-signed certificate for proxy.domain and stores it in a Secret it manages itself, with no external dependency at all (no cert-manager, no internet access for ACME) - so helm install works out of the box. The generated certificate is re-used across upgrades (the chart looks up the existing Secret before generating a new one), but is never automatically rotated - delete the generated Secret yourself to force regeneration. It only covers proxy.domain itself, not the per-service UUID subdomains - fine for CI/testing pipelines or fully private/internal deployments where clients don't need a publicly-trusted certificate. Switch to secret or acme below for a production setup with real external clients.

proxy:
  domain: "my-proxy.example.com"
  tls:
    source: selfSigned

secret - mount an existing Kubernetes Secret of type kubernetes.io/tls into the certificate directory. This is the natural fit if you already run cert-manager: a cert-manager Certificate issues into a Secret with keys tls.crt / tls.key, which are exactly the filenames the proxy expects by default. The proxy watches the certificate files and hot-reloads them, so cert-manager's automatic renewals are picked up without restarting the pod - no extra glue required. Since this is a single static certificate, if you're exposing services on their auto-generated UUID subdomains (the common case), it needs to be a wildcard certificate (*.my-proxy.example.com) to cover them - a certificate for just the bare domain will leave those services with a certificate mismatch.

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: my-proxy-tls
spec:
  secretName: my-proxy-tls
  dnsNames:
    - "*.my-proxy.example.com"
  issuerRef:
    name: letsencrypt-prod
    kind: ClusterIssuer
proxy:
  tls:
    source: secret
    existingSecret: my-proxy-tls

acme (recommended for production) - the proxy requests and renews its own certificates directly from Let's Encrypt (NB_PROXY_ACME_CERTIFICATES=true). Unlike the other two sources, this isn't a single static certificate: the proxy obtains one on demand, per actual hostname, the first time something connects for a domain the management server has told it about (via the mapping sync) - including each service's auto-generated UUID subdomain, automatically, with no wildcard needed. proxy.domain itself only gets a certificate this way if it's also an exposed service; connections to the bare domain otherwise correctly fail with unknown domain rather than serving a certificate for a domain nothing has authorized. No cert-manager dependency, but proxy.domain must be set, and the proxy must be reachable from the internet for the challenge. The default challenge type, tls-alpn-01, validates on whatever port is externally reachable as 443 - this chart's Service already forwards external 443 to proxy.address internally (see above), so the chart's non-privileged :8443 default works fine;

Deploy netbird-reverse-proxy with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has netbird-reverse-proxy on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartnetbird-reverse-proxy is pinned at v0.2.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply