NetBox is a network infrastructure management platform providing IP address management (IPAM), data center infrastructure management (DCIM), and network documentation capabilities.
- Namespace:
infra - Custom Image:
localhost/netbox-custom:latest(built in-cluster) - Access: VPN-only via HTTPS
- Storage: PostgreSQL database (external or in-cluster)
- Authentication: LDAP via FreeIPA (optional)
NetBox in Charon uses a custom Docker image with community plugins pre-installed. This is built in-cluster using the DaemonSet pattern with Buildah.
The custom image includes the following NetBox community plugins:
- netbox-topology-views - Network topology visualization
- netbox-prometheus-sd - Prometheus service discovery integration
- netbox-lists - Enhanced list views and filtering
The image build is managed by terraform/netbox-image-build.tf:
- ConfigMap contains the Dockerfile and
plugin_requirements.txt - DaemonSet runs on all nodes with privileged Buildah container
- Build happens in init container using Buildah
- Save to hostPath at
/var/lib/netbox-custom-image.tar - Import into containerd using
ctr -n k8s.io images import
- Pip bootstrap required: NetBox venv doesn't include pip by default
- Solution: Use
curl -sS https://bootstrap.pypa.io/get-pip.py | /opt/netbox/venv/bin/python
- Solution: Use
- Django SECRET_KEY length: Must be 50+ characters for
collectstatic - Fully qualified image names: Use
docker.io/netboxcommunity/netbox:latestto avoid Buildah short-name resolution errors
The custom image Dockerfile is maintained in a separate repository.
Before deploying, test the custom image build locally:
git clone https://github.com/your-org/netbox-plugins-bundled.git
cd netbox-plugins-bundled/
# Build the image
docker build -t localhost/netbox-custom:latest .
# Verify plugins installed
docker run --rm localhost/netbox-custom:latest \
/opt/netbox/venv/bin/pip list | grep netbox
# Expected output:
# netbox-topology-views 4.4.0
# netbox-prometheus-sd 0.5
# netbox-lists 4.0.3NetBox is configured via environment variables and a ConfigMap containing plugins_config.py:
PLUGINS = [
'netbox_topology_views',
'netbox_prometheus_sd',
'netbox_lists',
]
PLUGINS_CONFIG = {
'netbox_topology_views': {
'static_image_directory': 'netbox_topology_views/img',
'allow_coordinates_saving': True,
},
'netbox_prometheus_sd': {
'device_role': True,
'device_type': True,
'manufacturer': True,
'platform': True,
'region': True,
'site': True,
'tag': True,
},
'netbox_lists': {},
}In terraform.tfvars:
netbox_enabled = truecd terraform
terraform applyThis will:
- Create the image builder DaemonSet (builds on all nodes)
- Deploy NetBox StatefulSet with the custom image
- Configure DNS and TLS certificates
- Set up ingress and VPN access
# Check image builder status
kubectl get daemonset -n infra netbox-image-builder
# View build logs
kubectl logs -n infra -l app=netbox-image-builder -c build-and-import
# Check NetBox pod
kubectl get pods -n infra -l app=netbox
# Verify plugins loaded
kubectl logs -n infra netbox-0 -c netbox | grep -i pluginSymptom: DaemonSet init container fails
# View detailed build logs
kubectl logs -n infra netbox-image-builder-xxxxx -c build-and-import
# Common issues:
# - Pip not found: Check that get-pip.py bootstrap is included
# - SECRET_KEY too short: Must be 50+ characters
# - Short-name resolution: Use fully qualified image names (docker.io/...)Symptom: Plugins installed but not showing in NetBox UI
# Exec into NetBox container
kubectl exec -n infra netbox-0 -c netbox -it -- /bin/bash
# Verify plugins installed
/opt/netbox/venv/bin/pip list | grep netbox
# Check static files collected
ls -la /opt/netbox/netbox/static/
# Verify plugin configuration
cat /etc/netbox/config/plugins_config.pyResolution: Ensure collectstatic ran during build and plugins are listed in PLUGINS array.
# Check database connectivity
kubectl logs -n infra netbox-0 -c netbox
# Test database connection
kubectl exec -n infra netbox-0 -c netbox -it -- \
/opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py dbshellAfter deployment, access NetBox via VPN:
# Connect to VPN first
tailscale up --login-server https://vpn.example.com
# Access NetBox
open https://netbox.example.compattern
- Adding Services - Guide for adding new services
References
- netbox-plugins-bundled - Custom image source repository
- NetBox Documentation
Navigation: Documentation Index | Services | Home