NetBird is primarily designed for Docker Compose deployments. Kubernetes support is community-driven. For production Kubernetes deployments, consider using NetBird Cloud or contributing Helm charts to the project.
Prerequisites
- Kubernetes cluster (v1.20+)
kubectlconfigured with cluster access- Ingress controller (nginx, Traefik, or similar)
- Cert-manager for automatic TLS (recommended)
- Storage class for persistent volumes
Architecture on Kubernetes
A Kubernetes deployment of NetBird consists of:- NetBird Server Deployment - Combined server (management, signal, relay, STUN)
- Dashboard Deployment - Web UI
- ConfigMaps - For config.yaml and dashboard environment
- Secrets - For encryption keys and OAuth secrets
- Services - ClusterIP for internal communication, LoadBalancer/NodePort for STUN
- Ingress - HTTPS routing to dashboard and server
- PersistentVolumeClaim - For SQLite database storage
Namespace and ConfigMap
Create Namespace
ConfigMap for Server Configuration
Create a ConfigMap with the combined server configuration:ConfigMap for Dashboard
Secrets
Create secrets for sensitive data:Store these secrets securely in your secret management system (e.g., Sealed Secrets, External Secrets Operator, or HashiCorp Vault).
Persistent Storage
NetBird Server Deployment
Dashboard Deployment
Services
NetBird Server Service
Dashboard Service
Ingress Configuration
With Nginx Ingress Controller
For gRPC to work properly, ensure your ingress controller supports HTTP/2 and has appropriate timeout settings.
Cert-Manager ClusterIssuer
For automatic TLS certificates:Deployment
Apply all manifests:Verification
Scaling Considerations
Using SQLite (Default)
- Cannot scale beyond 1 replica
- Suitable for small deployments (less than 100 peers)
- Single point of failure
Using PostgreSQL/MySQL
For production Kubernetes deployments:- Deploy PostgreSQL or MySQL in the cluster
- Update config.yaml:
- Add environment variable to deployment:
- Scale to multiple replicas:
Monitoring
Prometheus Integration
NetBird exposes metrics on port 9090:Troubleshooting
Pods Not Starting
Ingress Issues
gRPC Connection Failures
Ensure ingress controller supports:- HTTP/2
- gRPC protocol
- Extended timeouts for long-lived connections
STUN Port Not Accessible
Community Resources
If you develop Helm charts or improved Kubernetes manifests, consider contributing them to the NetBird project!
Next Steps
Docker Compose
Simpler alternative for non-Kubernetes environments
NetBird Cloud
Managed NetBird without infrastructure management
Access Control
Configure network policies after deployment
Monitoring
Set up observability for your deployment