Deploying the Controller
The Bindy controller watches for DNS resources and manages BIND9 configurations.
Prerequisites
Before deploying the controller:
- CRDs must be installed
- RBAC must be configured
- Namespace must exist (
dns-systemrecommended)
Installation
Create Namespace
kubectl create namespace dns-system
Install RBAC
kubectl apply -f https://raw.githubusercontent.com/firestoned/bindy/main/deploy/rbac/
This creates:
- ServiceAccount for the controller
- ClusterRole with required permissions
- ClusterRoleBinding to bind them together
Deploy Controller
kubectl apply -f https://raw.githubusercontent.com/firestoned/bindy/main/deploy/controller/deployment.yaml
Wait for Readiness
kubectl wait --for=condition=available --timeout=300s \
deployment/bind9-controller -n dns-system
Verify Deployment
Check controller pod status:
kubectl get pods -n dns-system -l app=bind9-controller
Expected output:
NAME READY STATUS RESTARTS AGE
bind9-controller-7d4b8c4f9b-x7k2m 1/1 Running 0 1m
Check controller logs:
kubectl logs -n dns-system -l app=bind9-controller -f
You should see:
{"timestamp":"2024-01-01T00:00:00Z","level":"INFO","message":"Starting Bindy controller"}
{"timestamp":"2024-01-01T00:00:01Z","level":"INFO","message":"Watching DNSZone resources"}
{"timestamp":"2024-01-01T00:00:01Z","level":"INFO","message":"Watching DNS record resources"}
Configuration
Environment Variables
Configure the controller via environment variables:
| Variable | Default | Description |
|---|---|---|
RUST_LOG | info | Log level (error, warn, info, debug, trace) |
BIND9_ZONES_DIR | /etc/bind/zones | Directory for zone files |
RECONCILE_INTERVAL | 300 | Reconciliation interval in seconds |
Edit the deployment to customize:
env:
- name: RUST_LOG
value: "debug"
- name: BIND9_ZONES_DIR
value: "/var/lib/bind/zones"
Resource Limits
For production, set appropriate resource limits:
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
High Availability
Run multiple replicas with leader election:
spec:
replicas: 3
Troubleshooting
Controller Not Starting
-
Check pod events:
kubectl describe pod -n dns-system -l app=bind9-controller -
Check if CRDs are installed:
kubectl get crd | grep bindy.firestoned.io -
Check RBAC permissions:
kubectl auth can-i list dnszones --as=system:serviceaccount:dns-system:bind9-controller
High Memory Usage
If the controller uses excessive memory:
- Reduce log level:
RUST_LOG=warn - Increase resource limits
- Check for memory leaks in logs
Next Steps
- Quick Start Guide - Create your first DNS zone
- Configuration - Advanced configuration
- Monitoring - Set up monitoring