Operations
This section covers operational procedures for NetBox Enterprise.
Backup Procedures
Proper backup procedures are critical for data protection and disaster recovery.
Database Backups
PostgreSQL Backup
For External PostgreSQL
# Create backup using pg_dump
PGPASSWORD=your-password pg_dump \
-h postgresql-host \
-U username \
-d netbox \
--no-owner \
--clean \
--if-exists \
-f netbox-backup-$(date +%Y%m%d-%H%M%S).sql
For Internal PostgreSQL
For built-in database backup instructions, refer to the NetBox Enterprise manual backup and restore documentation. This includes:
- PostgreSQL backup using pg_dumpall
- Media, scripts, and reports backup
- Restore procedures with restore mode
For automated disaster recovery with S3-compatible storage, see the disaster recovery backup documentation.
Application Data Backups
For backing up media files, scripts, and reports, refer to the NetBox Enterprise manual backup documentation. This provides the complete procedure for backing up all application data using kubectl commands.
Backup Automation with Velero
The chart includes Velero annotations for backup:
# Install Velero in your cluster first
# Then create a backup
velero backup create netbox-backup \
--include-namespaces netbox-enterprise \
--ttl 720h
# Schedule automated backups
velero schedule create netbox-daily \
--schedule="0 2 * * *" \
--include-namespaces netbox-enterprise \
--ttl 720h
Restore Procedures
Using Restore Mode
The chart includes a restore mode for disaster recovery:
# Enable restore mode in values
global:
restoreMode:
enabled: true
# Deploy in restore mode
helm upgrade netbox-enterprise netbox/netbox-enterprise \
--namespace netbox-enterprise \
--values restore-values.yaml
Database Restore
For external PostgreSQL:
PGPASSWORD=your-password psql \
-h postgresql-host \
-U username \
-d netbox \
-f netbox-backup.sql
For internal PostgreSQL restore procedures, refer to the NetBox Enterprise restore documentation. This includes:
- Enabling restore mode
- Database restore procedures
- Media, scripts, and reports restoration
Support Bundle Generation
NetBox Enterprise includes built-in support for the troubleshoot.sh framework, providing automated support bundle generation.
Method 1: Using kubectl support-bundle (Recommended)
First, install the support-bundle kubectl plugin:
# Install the plugin
curl https://krew.sh/support-bundle | bash
# Generate support bundle
kubectl support-bundle --namespace netbox-enterprise
This automatically collects:
- Cluster information and resources
- NetBox deployment status
- Application logs (with configurable limits)
- Helm values
- Pod descriptions and events
- Network configurations
- Storage information
Method 2: Using the Built-in Support Bundle Definition
# The chart creates a support bundle specification
kubectl get secret -n netbox-enterprise netbox-enterprise-support-bundle -o jsonpath='{.data.support-bundle-spec}' | base64 -d > support-bundle.yaml
# Generate bundle using the specification
kubectl support-bundle support-bundle.yaml
Method 3: Generate Bundle for Failed Helm Installation
If a Helm installation fails and you want to collect a support bundle to assist with diagnostics, you can use a default specification to generate the support bundle:
kubectl support-bundle https://raw.githubusercontent.com/replicatedhq/troubleshoot-specs/main/in-cluster/default.yaml
Method 4: Manual Collection (Fallback)
If the above methods are unavailable, collect manually:
mkdir netbox-support-bundle
cd netbox-support-bundle
# Basic collection commands
kubectl cluster-info dump --namespace netbox-enterprise > cluster-dump.txt
kubectl get events -n netbox-enterprise > events.txt
helm get values netbox-enterprise -n netbox-enterprise > values.yaml
# Create bundle
tar czf netbox-support-bundle-$(date +%Y%m%d-%H%M%S).tar.gz *
Information to Include
When contacting support, include:
- Helm chart version
- Kubernetes version and platform
- Description of the issue
- Steps to reproduce
- Recent changes made
- Support bundle file
Maintenance Tasks
Database Maintenance
PostgreSQL Maintenance
# Run VACUUM ANALYZE
kubectl exec -n netbox-enterprise deployment/netbox-enterprise -- \
python manage.py dbshell -c "VACUUM ANALYZE;"
# Check database size
kubectl exec -n netbox-enterprise deployment/netbox-enterprise -- \
python manage.py dbshell -c "SELECT pg_database_size('netbox');"
CronJob Utilities
The chart includes maintenance CronJobs:
# List available CronJobs
kubectl get cronjobs -n netbox-enterprise
# The chart can enable:
# - Database cleanup jobs
# - Session cleanup
# - Old job result cleanup
Storage Management
Monitor and manage persistent volume usage:
# Check PVC usage
kubectl exec -n netbox-enterprise deployment/netbox-enterprise -- df -h /opt/netbox/netbox/media
To expand storage:
# Edit PVC size (only works with expandable storage classes)
kubectl patch pvc netbox-enterprise-user-data-volume \
-n netbox-enterprise \
--type merge \
-p '{"spec":{"resources":{"requests":{"storage":"50Gi"}}}}'
Upgrade Procedures
Standard Upgrades
# Check current version
helm list -n netbox-enterprise
# Upgrade to new version
helm upgrade netbox-enterprise \
oci://registry.netboxlabs.com/netbox-enterprise/beta/netbox-enterprise \
--values netbox-enterprise-values.yaml \
--values values-extra.yaml \
--version 1.11.5 \
--namespace netbox-enterprise
Scaling
Scale application components based on load:
# Scale web pods
kubectl scale deployment netbox-enterprise --replicas=3 -n netbox-enterprise
# Scale worker pods for background tasks
kubectl scale deployment netbox-enterprise-worker --replicas=2 -n netbox-enterprise
Resource Allocation
Production sizing recommendations:
# Add to your values file
netbox:
resources:
requests:
cpu: "500m"
memory: "2Gi"
limits:
cpu: "2000m"
memory: "4Gi"
worker:
resources:
requests:
cpu: "250m"
memory: "512Mi"
limits:
cpu: "1000m"
memory: "2Gi"
Next Steps
For troubleshooting and problem resolution:
- Troubleshooting - Common issues and solutions
For the complete workflow:
- Overview - Architecture overview
- Prerequisites - System requirements
- Installation - Installation procedures
- Operations (this guide) - Backup, upgrade, and scaling procedures
- Troubleshooting - Problem resolution