netbox
by bootc
IP address management (IPAM) and data center infrastructure management (DCIM) tool
About this chart
NetBox
NetBox is an IP address management (IPAM) and data center infrastructure management (DCIM) tool.
TL;DR
$ helm repo add bootc https://charts.boo.tc
$ helm install netbox \
--set postgresql.postgresqlPostgresPassword=[password1] \
--set postgresql.postgresqlPassword=[password2] \
--set redis.auth.password=[password3] \
bootc/netbox
Prerequisites
- This chart has only been tested on Kubernetes 1.18+, but should work on 1.14+
- This chart works with NetBox 3.0.0+ (3.0.11+ recommended)
- Recent versions of Helm 3 are supported
Installing the Chart
To install the chart with the release name my-release and default configuration:
$ helm repo add bootc https://charts.boo.tc
$ helm install my-release \
--set postgresql.postgresqlPostgresPassword=[password1] \
--set postgresql.postgresqlPassword=[password2] \
--set redis.auth.password=[password3] \
bootc/netbox
The default configuration includes the required PostgreSQL and Redis database services, but either or both may be managed externally if required.
Production Usage
Always use an existing Secret and supply all passwords and secret keys yourself to avoid Helm re-generating any of them for you.
I strongly recommend setting both postgresql.enabled and redis.enabled to
false and using a separate external PostgreSQL and Redis instance. This
de-couples those services from the chart's bundled versions which may have
complex upgrade requirements. I also recommend using a clustered PostgreSQL
server (e.g. using Zalando's
Postgres Operator) and Redis
with Sentinel (e.g. using Aaron Layfield's
redis-ha chart).
Set persistence.enabled to false and use the S3 storageBackend for object
storage. This works well with Minio or Ceph RGW as well as Amazon S3.
Run multiple replicas of the NetBox web front-end to avoid interruptions during
upgrades or at other times when the pods need to be restarted. There's no need
to have multiple workers (worker.replicaCount) for better availability. Set
up affinity.podAntiAffinity to avoid multiple NetBox pods being colocated on
the same node, for example:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/instance: netbox
app.kubernetes.io/name: netbox
app.kubernetes.io/component: netbox
topologyKey: kubernetes.io/hostname
Uninstalling the Chart
To delete the chart:
$ helm delete my-release
Upgrading
Bundled PostgreSQL
When upgrading or changing settings and using the bundled Bitnami PostgreSQL
sub-chart, you must provide the postgresql.postgresqlPassword at minimum.
Ideally you should also supply the postgresql.postgresqlPostgresPassword and,
if using replication, the postgresql.replication.password. Please see the
upstream documentation
for further information.
From 3.x to 4.x
- NetBox 3.0.0 or above is required
- The Bitnami Redis sub-chart was upgraded from 12.x to 15.x; please read the upstream upgrade notes if you are using the bundled Redis
- The
cacheTimeoutandreleaseCheck.timeoutsettings were removed
From 2.x to 3.x
- NetBox 2.10.4 or above is required
- Kubernetes 1.14 or above is required
- Helm v3 or above is now required
- The
netboxDeployment selectors are changed, so the Deployment must be deleted on upgrades - The Bitnami PostgreSQL sub-chart was upgraded from 8.x to 10.x; please read the upstream upgrade notes if you are using the bundled PostgreSQL
- The Bitnami Redis sub-chart was upgraded from 10.x to 12.x; please read the upstream upgrade notes if you are using the bundled Redis
- The NGINX container is removed, on account of upstream's migration from Gunicorn to NGINX Unit
- The
webhooksRedisconfiguration key invalues.yamlhas been renamed totasksRedisto match the upstream name - The
redis_passwordkey in the Secret has been renamed toredis_tasks_password
From 1.x to 2.x
If you use an external Redis you will need to update your configuration values due to the chart reflecting upstream changes in how it uses Redis. There are now separate Redis configuration blocks for webhooks and for caching, though they can both point at the same Redis instance as long as the database numbers are different.
From 0.x to 1.x
The chart dependencies on PostgreSQL and Redis have been upgraded, so you may need to take action depending on how you have configured the chart. The PostgreSQL chart was upgraded from 5.x.x to 7.x.x, and Redis from 8.x.x to 9.x.x.
Configuration
The following table lists the configurable parameters for this chart and their default values.
| Parameter | Description | Default |
|---|---|---|
replicaCount | The desired number of NetBox pods | 1 |
image.repository | NetBox container image repository | netboxcommunity/netbox |
image.tag | NetBox container image tag | "" |
image.pullPolicy | NetBox container image pull policy | IfNotPresent |
superuser.name | Initial super-user account to create | admin |
superuser.email | Email address for the initial super-user account | [email protected] |
superuser.password | Password for the initial super-user account | admin |
superuser.apiToken | API token created for the initial super-user account | 0123456789abcdef0123456789abcdef01234567 |
skipStartupScripts | Skip [netbox-docker startup scripts] | true |
allowedHosts | List of valid FQDNs for this NetBox instance | ["*"] |
admins | List of admins to email about critical errors | [] |
authPasswordValidators | Configure validation of local user account passwords | [] |
allowedUrlSchemes | URL schemes that are allowed within links in NetBox | see values.yaml |
banner.top | Banner text to display at the top of every page | "" |
banner.bottom | Banner text to display at the bottom of every page | "" |
banner.login | Banner text to display on the login page | "" |
basePath | Base URL path if accessing NetBox within a directory | "" |
changelogRetention | Maximum number of days to retain logged changes (0 = forever) | 90 |
customValidators | Custom validators for NetBox field values | {} |
defaultUserPreferences | Default preferences for newly created user accounts | {} |
cors.originAllowAll | [CORS]: allow all origins | false |
cors.originWhitelist | [CORS]: list of origins authorised to make cross-site HTTP requests | [] |
cors.originRegexWhitelist | [CORS]: list of regex strings matching authorised origins | [] |
csrf.cookieName | Name of the CSRF authentication cookie | csrftoken |
csrf.trustedOrigins | A list of trusted origins for unsafe (e.g. POST) requests | [] |
debug | Enable NetBox debugging (NOT for production use) | false |
dbWaitDebug | Show details of errors that occur when applying migrations | false |
email.server | SMTP server to use to send emails | localhost |
email.port | TCP port to connect to the SMTP server on | 25 |
email.username | Optional username for SMTP authentication | "" |
email.password | Password for SMTP authentication (see also existingSecret) | "" |
email.useSSL | Use SSL when connecting to the server | false |
email.useTLS | Use TLS when connecting to the server | false |
email.sslCertFile | SMTP SSL certificate file path (e.g. in a mounted volume) | "" |
email.sslKeyFile | SMTP SSL key file path (e.g. in a mounted volume) | "" |
email.timeout | Timeout for SMTP connections, in seconds | 10 |
email.from | Sender address for emails sent by NetBox | "" |
enforceGlobalUnique | Enforce unique IP space in the global table (not in a VRF) | false |
exemptViewPermissions | A list of models to exempt from the enforcement of view permissions | [] |
fieldChoices | Configure custom choices for certain built-in fields | {} |
graphQlEnabled | Enable the GraphQL API | true |
httpProxies | HTTP proxies NetBox should use when sending outbound HTTP requests | null |
internalIPs | IP addresses recognized as internal to the system | ['127.0.0.1', '::1'] |
jobResultRetention | The number of days to retain job results (scripts and reports) | 90 |
logging | Custom Django logging configuration | {} |
loginPersistence | Enables users to remain authenticated to NetBox indefinitely | false |
loginRequired | Permit only logged-in users to access NetBox | false (unauthenticated read-only access) |
loginTimeout | How often to re-authenticate users | 1209600 (14 days) |
maintenanceMode | Display a "maintenance mode" banner on every page | false |
mapsUrl | The URL to use when mapping physical addresses or GPS coordinates | `https://maps.goog |
Deploy netbox with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has netbox 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartnetbox is pinned at v4.1.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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