Skip to content

Repository files navigation

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 cacheTimeout and releaseCheck.timeout settings 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 netbox Deployment 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 webhooksRedis configuration key in values.yaml has been renamed to tasksRedis to match the upstream name
  • The redis_password key in the Secret has been renamed to redis_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.

ParameterDescriptionDefault
replicaCountThe desired number of NetBox pods1
image.repositoryNetBox container image repositorynetboxcommunity/netbox
image.tagNetBox container image tag""
image.pullPolicyNetBox container image pull policyIfNotPresent
superuser.nameInitial super-user account to createadmin
superuser.emailEmail address for the initial super-user accountadmin@example.com
superuser.passwordPassword for the initial super-user accountadmin
superuser.apiTokenAPI token created for the initial super-user account0123456789abcdef0123456789abcdef01234567
skipStartupScriptsSkip netbox-docker startup scriptstrue
allowedHostsList of valid FQDNs for this NetBox instance["*"]
adminsList of admins to email about critical errors[]
authPasswordValidatorsConfigure validation of local user account passwords[]
allowedUrlSchemesURL schemes that are allowed within links in NetBoxsee values.yaml
banner.topBanner text to display at the top of every page""
banner.bottomBanner text to display at the bottom of every page""
banner.loginBanner text to display on the login page""
basePathBase URL path if accessing NetBox within a directory""
changelogRetentionMaximum number of days to retain logged changes (0 = forever)90
customValidatorsCustom validators for NetBox field values{}
defaultUserPreferencesDefault preferences for newly created user accounts{}
cors.originAllowAllCORS: allow all originsfalse
cors.originWhitelistCORS: list of origins authorised to make cross-site HTTP requests[]
cors.originRegexWhitelistCORS: list of regex strings matching authorised origins[]
csrf.cookieNameName of the CSRF authentication cookiecsrftoken
csrf.trustedOriginsA list of trusted origins for unsafe (e.g. POST) requests[]
debugEnable NetBox debugging (NOT for production use)false
dbWaitDebugShow details of errors that occur when applying migrationsfalse
email.serverSMTP server to use to send emailslocalhost
email.portTCP port to connect to the SMTP server on25
email.usernameOptional username for SMTP authentication""
email.passwordPassword for SMTP authentication (see also existingSecret)""
email.useSSLUse SSL when connecting to the serverfalse
email.useTLSUse TLS when connecting to the serverfalse
email.sslCertFileSMTP SSL certificate file path (e.g. in a mounted volume)""
email.sslKeyFileSMTP SSL key file path (e.g. in a mounted volume)""
email.timeoutTimeout for SMTP connections, in seconds10
email.fromSender address for emails sent by NetBox""
enforceGlobalUniqueEnforce unique IP space in the global table (not in a VRF)false
exemptViewPermissionsA list of models to exempt from the enforcement of view permissions[]
fieldChoicesConfigure custom choices for certain built-in fields{}
graphQlEnabledEnable the GraphQL APItrue
httpProxiesHTTP proxies NetBox should use when sending outbound HTTP requestsnull
internalIPsIP addresses recognized as internal to the system['127.0.0.1', '::1']
jobResultRetentionThe number of days to retain job results (scripts and reports)90
loggingCustom Django logging configuration{}
loginPersistenceEnables users to remain authenticated to NetBox indefinitelyfalse
loginRequiredPermit only logged-in users to access NetBoxfalse (unauthenticated read-only access)
loginTimeoutHow often to re-authenticate users1209600 (14 days)
maintenanceModeDisplay a "maintenance mode" banner on every pagefalse
mapsUrlThe URL to use when mapping physical addresses or GPS coordinateshttps://maps.google.com/?q=
maxPageSizeMaximum number of objects that can be returned by a single API call1000
storageBackendDjango-storages backend class namenull
storageConfigDjango-storages backend configuration{}
metricsEnabledExpose Prometheus metrics at the /metrics HTTP endpointfalse
napalm.usernameUsername used by the NAPALM library to access network devices""
napalm.passwordPassword used by the NAPALM library (see also existingSecret)""
napalm.timeoutTimeout for NAPALM to connect to a device (in seconds)30
napalm.argsA dictionary of optional arguments to pass to NAPALM{}
paginateCountThe default number of objects to display per page in the web UI50
pluginsAdditional plugins to load into NetBox[]
pluginsConfigConfiguration for the additional plugins{}
powerFeedDefaultAmperageDefault amperage value for new power feeds15
powerFeedMaxUtilisationDefault maximum utilisation percentage for new power feeds80
powerFeedDefaultVoltageDefault voltage value for new power feeds120
preferIPv4Prefer devices' IPv4 address when determining their primary addressfalse
rackElevationDefaultUnitHeightRack elevation default height in pixels22
rackElevationDefaultUnitWidthRack elevation default width in pixels220
remoteAuth.enabledEnable remote authentication supportfalse
remoteAuth.backendRemote authentication backend classnetbox.authentication.RemoteUserBackend
remoteAuth.headerThe name of the HTTP header which conveys the usernameHTTP_REMOTE_USER
remoteAuth.autoCreateUserEnables the automatic creation of new userstrue
remoteAuth.defaultGroupsA list of groups to assign to newly created users[]
remoteAuth.defaultPermissionsA list of permissions to assign newly created users{}
remoteAuth.groupSyncEnabledSync remote user groups from an HTTP header set by a reverse proxyfalse
remoteAuth.groupHeaderThe name of the HTTP header which conveys the groups to which the user belongsHTTP_REMOTE_USER_GROUP
remoteAuth.superuserGroupsThe list of groups that promote an remote User to Superuser on login[]
remoteAuth.superusersThe list of users that get promoted to Superuser on login[]
remoteAuth.staffGroupsThe list of groups that promote an remote User to Staff on login[]
remoteAuth.staffUsersThe list of users that get promoted to Staff on login[]
remoteAuth.groupSeparatorThe Seperator upon which remoteAuth.groupHeader gets split into individual groups|
remoteAuth.ldap.serverUrisee django-auth-ldap""
remoteAuth.ldap.startTlsif StarTLS should be usedsee values.yaml
remoteAuth.ldap.ignoreCertErrorsif Certificate errors should be ignoredsee values.yaml
remoteAuth.ldap.bindDnDistinguished Name to bind with""
remoteAuth.ldap.bindPasswordPassword for bind DN""
remoteAuth.ldap.userDnTemplatesee AUTH_LDAP_USER_DN_TEMPLATEsee values.yaml
remoteAuth.ldap.userSearchBaseDnsee base_dn of django_auth_ldap.config.LDAPSearchsee values.yaml
remoteAuth.ldap.userSearchAttrUser attribute name for user searchsAMAccountName
remoteAuth.ldap.groupSearchBaseDnbase DN for group searchsee values.yaml
remoteAuth.ldap.groupSearchClassdjango-auth-ldap for group searchgroup
remoteAuth.ldap.groupTypesee AUTH_LDAP_GROUP_TYPEGroupOfNamesType
remoteAuth.ldap.requireGroupDnDN of a group that is required for loginnull
remoteAuth.ldap.findGroupPermssee AUTH_LDAP_FIND_GROUP_PERMStrue
remoteAuth.ldap.mirrorGroupssee AUTH_LDAP_MIRROR_GROUPSnull
remoteAuth.ldap.cacheTimeoutsee AUTH_LDAP_MIRROR_GROUPS_EXCEPTnull
remoteAuth.ldap.isAdminDnrequired DN to be able to login in Admin-Backend, "is_staff"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.isSuperUserDnrequired DN to receive SuperUser privileges, "is_superuser"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.attrFirstNamefirst name attribute of users, "first_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPgivenName
remoteAuth.ldap.attrLastNamelast name attribute of users, "last_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPsn
remoteAuth.ldap.attrMailmail attribute of users, "email_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPmail
releaseCheck.urlRelease check URL (GitHub API URL; see values.yaml)null (disabled by default)
rqDefaultTimeoutMaximum execution time for background tasks, in seconds300 (5 minutes)
sessionCookieNameThe name to use for the session cookie"sessionid"
timeZoneThe time zone NetBox will use when dealing with dates and timesUTC
dateFormatDjango date format for long-form date strings"N j, Y"
shortDateFormatDjango date format for short-form date strings"Y-m-d"
timeFormatDjango date format for long-form time strings"g:i a"
shortTimeFormatDjango date format for short-form time strings"H:i:s"
dateTimeFormatDjango date format for long-form date and time strings"N j, Y g:i a"
shortDateTimeFormatDjango date format for short-form date and time strongs"Y-m-d H:i"
secretKeyDjango secret key used for sessions and password reset tokens"" (generated)
existingSecretUse an existing Kubernetes Secret for secret values (see below)"" (use individual chart values)
extraConfigAdditional NetBox configuration (see values.yaml)[]
postgresql.enabledDeploy PostgreSQL using bundled Bitnami PostgreSQL charttrue
postgresql.postgresqlUsernameUsername to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.postgresqlDatabaseDatabase to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.*Values under this key are passed to the bundled PostgreSQL chartn/a
externalDatabase.hostPostgreSQL host to use when postgresql.enabled is falselocalhost
externalDatabase.portPort number for external PostgreSQL5432
externalDatabase.databaseDatabase name for external PostgreSQLnetbox
externalDatabase.usernameUsername for external PostgreSQLnetbox
externalDatabase.passwordPassword for external PostgreSQL (see also existingSecret)""
externalDatabase.existingSecretNameFetch password for external PostgreSQL from a different Secret""
externalDatabase.existingSecretKeyKey to fetch the password in the above Secretpostgresql-password
externalDatabase.sslModePostgreSQL client SSL Mode settingprefer
externalDatabase.connMaxAgeThe lifetime of a database connection, as an integer of seconds300
redis.enabledDeploy Redis using bundled Bitnami Redis charttrue
redis.*Values under this key are passed to the bundled Redis chartn/a
tasksRedis.databaseRedis database number used for NetBox task queue0
tasksRedis.sslEnable SSL when connecting to Redisfalse
tasksRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
tasksRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
tasksRedis.portPort number for external Redis6379
tasksRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
tasksRedis.sentinelServiceSentinel master service name"netbox-redis"
tasksRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
tasksRedis.passwordPassword for external Redis (see also existingSecret)""
tasksRedis.existingSecretNameFetch password for external Redis from a different Secret""
tasksRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
cachingRedis.databaseRedis database number used for caching views1
cachingRedis.sslEnable SSL when connecting to Redisfalse
cachingRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
cachingRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
cachingRedis.portPort number for external Redis6379
cachingRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
cachingRedis.sentinelServiceSentinel master service name"netbox-redis"
cachingRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
cachingRedis.passwordPassword for external Redis (see also existingSecret)""
cachingRedis.existingSecretNameFetch password for external Redis from a different Secret""
cachingRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
imagePullSecretsList of Secret names containing private registry credentials[]
nameOverrideOverride the application name (netbox) used throughout the chart""
fullnameOverrideOverride the full name of resources created as part of the release""
serviceAccount.createCreate a ServiceAccount for NetBoxtrue
serviceAccount.annotationsAnnotations to add to the service account{}
serviceAccount.nameThe name of the service account to use"" (use the fullname)
persistence.enabledEnable storage persistence for uploaded media (images)true
persistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
persistence.subPathMount a sub-path of the volume into the container, not the root""
persistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
persistence.selectorSet the selector for PVs, if desired{}
persistence.accessModeAccess mode for the volumeReadWriteOnce
persistence.sizeSize of persistent volume to request1Gi
reportsPersistence.enabledEnable storage persistence for NetBox reportsfalse
reportsPersistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
reportsPersistence.subPathMount a sub-path of the volume into the container, not the root""
reportsPersistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
reportsPersistence.selectorSet the selector for PVs, if desired{}
reportsPersistence.accessModeAccess mode for the volumeReadWriteOnce
reportsPersistence.sizeSize of persistent volume to request1Gi
podAnnotationsAdditional annotations for NetBox pods{}
podLabelsAdditional labels for NetBox pods{}
podSecurityContextSecurity context for NetBox podssee values.yaml
securityContextSecurity context for NetBox containerssee values.yaml
service.typeType of Service resource to createClusterIP
service.portPort number for the service80
service.nodePortThe port used on the node when service.type is NodePort""
service.clusterIPThe cluster IP address assigned to the service""
service.clusterIPsA list of cluster IP addresses assigned to the service[]
service.externalIPsA list of external IP addresses aliased to this service[]
service.externalTrafficPolicyPolicy for routing external traffic""
service.ipFamilyPolicyRepresents the dual-stack-ness of the service""
service.loadBalancerIPRequest a specific IP address when service.type is LoadBalancer""
service.loadBalancerSourceRangesA list of allowed IP ranges when service.type is LoadBalancer[]
ingress.enabledCreate an Ingress resource for accessing NetBoxfalse
ingress.classNameUse a named IngressClass""
ingress.annotationsExtra annotations to apply to the Ingress resource{}
ingress.hostsList of hosts and paths to map to the service (see values.yaml)[{host:"chart-example.local",paths:["/"]}]
ingress.tlsTLS settings for the Ingress resource[]
resourcesConfigure resource requests or limits for NetBox{}
readinessProbe.enabledEnable Kubernetes readinessProbe, see readiness probessee values.yaml
readinessProbe.initialDelaySecondsNumber of secondssee values.yaml
readinessProbe.timeoutSecondsNumber of secondssee values.yaml
readinessProbe.periodSecondsNumber of secondssee values.yaml
readinessProbe.successThresholdNumber of secondssee values.yaml
init.image.repositoryInit container image repositorybusybox
init.image.tagInit container image tag1.32.1
init.image.pullPolicyInit container image pull policyIfNotPresent
init.resourcesConfigure resource requests or limits for init container{}
init.securityContextSecurity context for init containersee values.yaml
autoscaling.enabledWhether to enable the HorizontalPodAutoscalerfalse
autoscaling.minReplicasMinimum number of replicas when autoscaling is enabled1
autoscaling.maxReplicasMaximum number of replicas when autoscaling is enabled100
autoscaling.targetCPUUtilizationPercentageTarget CPU utilisation percentage for autoscaling80
autoscaling.targetMemoryUtilizationPercentageTarget memory utilisation percentage for autoscalingnull
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
updateStrategyConfigure deployment update strategy{} (defaults to RollingUpdate)
affinityAffinity settings for pod assignment{}
extraEnvsAdditional environment variables to set in the NetBox container[]
extraVolumeMountsAdditional volumes to mount in the NetBox container[]
extraVolumesAdditional volumes to reference in pods[]
extraContainersAdditional sidecar containers to be added to pods[]
extraInitContainersAdditional init containers to run before starting main containers[]
workerWorker specific variables. Most global variables also apply here.see values.yaml
housekeeping.enabledWhether the HousekeepingCronJob should be activetrue
housekeeping.concurrencyPolicyConcurrencyPolicy for the Housekeeping CronJob.Forbid
housekeeping.failedJobsHistoryLimitNumber of failed jobs to keep in history5
housekeeping.restartPolicyRestart Policy for the Housekeeping CronJob.OnFailure
housekeeping.scheduleSchedule for the CronJob in Cron syntax.0 0 * * * (Midnight daily)
housekeeping.successfulJobsHistoryLimitNumber of successful jobs to keep in history5
housekeeping.suspendWhether to suspend the CronJobfalse
housekeeping.podAnnotationsAdditional annotations for housekeeping CronJob pods{}
housekeeping.podLabelsAdditional labels for housekeeping CronJob pods{}
housekeeping.podSecurityContextSecurity context for housekeeping CronJob podssee values.yaml
housekeeping.securityContextSecurity context for housekeeping CronJob containerssee values.yaml
housekeeping.resourcesConfigure resource requests or limits for housekeeping CronJob{}
housekeeping.nodeSelectorNode labels for housekeeping CronJob pod assignment{}
housekeeping.tolerationsToleration labels for housekeeping CronJob pod assignment[]
housekeeping.affinityAffinity settings for housekeeping CronJob pod assignment{}
housekeeping.extraEnvsAdditional environment variables to set in housekeeping CronJob[]
housekeeping.extraVolumeMountsAdditional volumes to mount in the housekeeping CronJob[]
housekeeping.extraVolumesAdditional volumes to reference in housekeeping CronJob pods[]
housekeeping.extraContainersAdditional sidecar containers to be added to housekeeping CronJob[]
housekeeping.extraInitContainersAdditional init containers for housekeeping CronJob pods[]

Specify each parameter using the --set key=value[,key=value] argument to helm install or provide a YAML file containing the values for the above parameters:

$ helm install --name my-release bootc/netbox --values values.yaml

Using an Existing Secret

Rather than specifying passwords and secrets as part of the Helm release values, you may pass these to NetBox using a pre-existing Secret resource. When using this, the Secret must contain the following keys:

KeyDescriptionRequired?
db_passwordThe password for the external PostgreSQL databaseIf postgresql.enabled is false and externalDatabase.existingSecretName is unset
email_passwordSMTP user passwordYes, but the value may be left blank if not required
ldap_bind_passwordPassword for LDAP bind DNIf remoteAuth.enabled is true and remoteAuth.backend is netbox.authentication.LDAPBackend
napalm_passwordNAPALM user passwordYes, but the value may be left blank if not required
redis_tasks_passwordPassword for the external Redis tasks databaseIf redis.enabled is false and tasksRedis.existingSecretName is unset
redis_cache_passwordPassword for the external Redis cache databaseIf redis.enabled is false and cachingRedis.existingSecretName is unset
secret_keyDjango secret key used for sessions and password reset tokensYes
superuser_passwordPassword for the initial super-user accountYes
superuser_api_tokenAPI token created for the initial super-user accountYes

Using extraConfig for S3 storage configuration

If you want to use S3 as your storage backend and not have the config in the values.yaml (credentials!) you can use an existing secret that is then referenced under the extraConfig key.

The secret would look like this:

apiVersion: v1kind: Secretmetadata:
labels:
app.kubernetes.io/instance: netboxname: netbox-extrastringData:
s3-config.yaml: | STORAGE_CONFIG: AWS_S3_ENDPOINT_URL: <endpoint-URL> AWS_S3_REGION_NAME: <region> AWS_STORAGE_BUCKET_NAME: <bucket-name> AWS_ACCESS_KEY_ID: <access-key> AWS_SECRET_ACCESS_KEY: <secret-key>

And the secret then has to be referenced like this:

extraConfig:
- secret: # same as pod.spec.volumes.secretsecretName: netbox-extra

Configuring SSO

You can leverage the extraConfig value in conjunction with remoteAuth to configure SSO. An example:

remoteAuth:
enabled: truebackend: social_core.backends.keycloak.KeycloakOAuth2autoCreateUser: falseextraConfig:
- values:
SOCIAL_AUTH_KEYCLOAK_KEY: 'netbox'SOCIAL_AUTH_KEYCLOAK_SECRET: 'HaveANiceDay'SOCIAL_AUTH_KEYCLOAK_PUBLIC_KEY: 'MII....'SOCIAL_AUTH_KEYCLOAK_AUTHORIZATION_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/auth'SOCIAL_AUTH_KEYCLOAK_ACCESS_TOKEN_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/token'SOCIAL_AUTH_KEYCLOAK_ID_KEY: 'email'SOCIAL_AUTH_JSONFIELD_ENABLED: True

Using LDAP Authentication

In order to enable LDAP authentication, please carry out the following steps:

  1. Set image.tag in your values to an image with LDAP support (e.g. v3.0.11-ldap)
  2. Configure the remoteAuth settings to enable the LDAP backend (see below)
  3. Make sure you set all of the remoteAuth.ldap settings shown in the values.yaml file

For example:

remoteAuth:
enabled: truebackend: netbox.authentication.LDAPBackendldap:
serverUri: 'ldap://domain.com'startTls: trueignoreCertErrors: truebindDn: ''bindPassword: ''# and ALL the other remoteAuth.ldap.* settings from values.yaml

Note: in order to use anonymous LDAP binding set bindDn and bindPassword to an empty string as in the example above.

License

The following notice applies to all files contained within this Helm Chart and the Git repository which contains it:

Copyright 2019-2020 Chris Boot

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A Helm chart for NetBox

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - gesv/netbox-chart: A Helm chart for NetBox · GitHub
Skip to content

Repository files navigation

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 cacheTimeout and releaseCheck.timeout settings 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 netbox Deployment 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 webhooksRedis configuration key in values.yaml has been renamed to tasksRedis to match the upstream name
  • The redis_password key in the Secret has been renamed to redis_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.

ParameterDescriptionDefault
replicaCountThe desired number of NetBox pods1
image.repositoryNetBox container image repositorynetboxcommunity/netbox
image.tagNetBox container image tag""
image.pullPolicyNetBox container image pull policyIfNotPresent
superuser.nameInitial super-user account to createadmin
superuser.emailEmail address for the initial super-user accountadmin@example.com
superuser.passwordPassword for the initial super-user accountadmin
superuser.apiTokenAPI token created for the initial super-user account0123456789abcdef0123456789abcdef01234567
skipStartupScriptsSkip netbox-docker startup scriptstrue
allowedHostsList of valid FQDNs for this NetBox instance["*"]
adminsList of admins to email about critical errors[]
authPasswordValidatorsConfigure validation of local user account passwords[]
allowedUrlSchemesURL schemes that are allowed within links in NetBoxsee values.yaml
banner.topBanner text to display at the top of every page""
banner.bottomBanner text to display at the bottom of every page""
banner.loginBanner text to display on the login page""
basePathBase URL path if accessing NetBox within a directory""
changelogRetentionMaximum number of days to retain logged changes (0 = forever)90
customValidatorsCustom validators for NetBox field values{}
defaultUserPreferencesDefault preferences for newly created user accounts{}
cors.originAllowAllCORS: allow all originsfalse
cors.originWhitelistCORS: list of origins authorised to make cross-site HTTP requests[]
cors.originRegexWhitelistCORS: list of regex strings matching authorised origins[]
csrf.cookieNameName of the CSRF authentication cookiecsrftoken
csrf.trustedOriginsA list of trusted origins for unsafe (e.g. POST) requests[]
debugEnable NetBox debugging (NOT for production use)false
dbWaitDebugShow details of errors that occur when applying migrationsfalse
email.serverSMTP server to use to send emailslocalhost
email.portTCP port to connect to the SMTP server on25
email.usernameOptional username for SMTP authentication""
email.passwordPassword for SMTP authentication (see also existingSecret)""
email.useSSLUse SSL when connecting to the serverfalse
email.useTLSUse TLS when connecting to the serverfalse
email.sslCertFileSMTP SSL certificate file path (e.g. in a mounted volume)""
email.sslKeyFileSMTP SSL key file path (e.g. in a mounted volume)""
email.timeoutTimeout for SMTP connections, in seconds10
email.fromSender address for emails sent by NetBox""
enforceGlobalUniqueEnforce unique IP space in the global table (not in a VRF)false
exemptViewPermissionsA list of models to exempt from the enforcement of view permissions[]
fieldChoicesConfigure custom choices for certain built-in fields{}
graphQlEnabledEnable the GraphQL APItrue
httpProxiesHTTP proxies NetBox should use when sending outbound HTTP requestsnull
internalIPsIP addresses recognized as internal to the system['127.0.0.1', '::1']
jobResultRetentionThe number of days to retain job results (scripts and reports)90
loggingCustom Django logging configuration{}
loginPersistenceEnables users to remain authenticated to NetBox indefinitelyfalse
loginRequiredPermit only logged-in users to access NetBoxfalse (unauthenticated read-only access)
loginTimeoutHow often to re-authenticate users1209600 (14 days)
maintenanceModeDisplay a "maintenance mode" banner on every pagefalse
mapsUrlThe URL to use when mapping physical addresses or GPS coordinateshttps://maps.google.com/?q=
maxPageSizeMaximum number of objects that can be returned by a single API call1000
storageBackendDjango-storages backend class namenull
storageConfigDjango-storages backend configuration{}
metricsEnabledExpose Prometheus metrics at the /metrics HTTP endpointfalse
napalm.usernameUsername used by the NAPALM library to access network devices""
napalm.passwordPassword used by the NAPALM library (see also existingSecret)""
napalm.timeoutTimeout for NAPALM to connect to a device (in seconds)30
napalm.argsA dictionary of optional arguments to pass to NAPALM{}
paginateCountThe default number of objects to display per page in the web UI50
pluginsAdditional plugins to load into NetBox[]
pluginsConfigConfiguration for the additional plugins{}
powerFeedDefaultAmperageDefault amperage value for new power feeds15
powerFeedMaxUtilisationDefault maximum utilisation percentage for new power feeds80
powerFeedDefaultVoltageDefault voltage value for new power feeds120
preferIPv4Prefer devices' IPv4 address when determining their primary addressfalse
rackElevationDefaultUnitHeightRack elevation default height in pixels22
rackElevationDefaultUnitWidthRack elevation default width in pixels220
remoteAuth.enabledEnable remote authentication supportfalse
remoteAuth.backendRemote authentication backend classnetbox.authentication.RemoteUserBackend
remoteAuth.headerThe name of the HTTP header which conveys the usernameHTTP_REMOTE_USER
remoteAuth.autoCreateUserEnables the automatic creation of new userstrue
remoteAuth.defaultGroupsA list of groups to assign to newly created users[]
remoteAuth.defaultPermissionsA list of permissions to assign newly created users{}
remoteAuth.groupSyncEnabledSync remote user groups from an HTTP header set by a reverse proxyfalse
remoteAuth.groupHeaderThe name of the HTTP header which conveys the groups to which the user belongsHTTP_REMOTE_USER_GROUP
remoteAuth.superuserGroupsThe list of groups that promote an remote User to Superuser on login[]
remoteAuth.superusersThe list of users that get promoted to Superuser on login[]
remoteAuth.staffGroupsThe list of groups that promote an remote User to Staff on login[]
remoteAuth.staffUsersThe list of users that get promoted to Staff on login[]
remoteAuth.groupSeparatorThe Seperator upon which remoteAuth.groupHeader gets split into individual groups|
remoteAuth.ldap.serverUrisee django-auth-ldap""
remoteAuth.ldap.startTlsif StarTLS should be usedsee values.yaml
remoteAuth.ldap.ignoreCertErrorsif Certificate errors should be ignoredsee values.yaml
remoteAuth.ldap.bindDnDistinguished Name to bind with""
remoteAuth.ldap.bindPasswordPassword for bind DN""
remoteAuth.ldap.userDnTemplatesee AUTH_LDAP_USER_DN_TEMPLATEsee values.yaml
remoteAuth.ldap.userSearchBaseDnsee base_dn of django_auth_ldap.config.LDAPSearchsee values.yaml
remoteAuth.ldap.userSearchAttrUser attribute name for user searchsAMAccountName
remoteAuth.ldap.groupSearchBaseDnbase DN for group searchsee values.yaml
remoteAuth.ldap.groupSearchClassdjango-auth-ldap for group searchgroup
remoteAuth.ldap.groupTypesee AUTH_LDAP_GROUP_TYPEGroupOfNamesType
remoteAuth.ldap.requireGroupDnDN of a group that is required for loginnull
remoteAuth.ldap.findGroupPermssee AUTH_LDAP_FIND_GROUP_PERMStrue
remoteAuth.ldap.mirrorGroupssee AUTH_LDAP_MIRROR_GROUPSnull
remoteAuth.ldap.cacheTimeoutsee AUTH_LDAP_MIRROR_GROUPS_EXCEPTnull
remoteAuth.ldap.isAdminDnrequired DN to be able to login in Admin-Backend, "is_staff"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.isSuperUserDnrequired DN to receive SuperUser privileges, "is_superuser"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.attrFirstNamefirst name attribute of users, "first_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPgivenName
remoteAuth.ldap.attrLastNamelast name attribute of users, "last_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPsn
remoteAuth.ldap.attrMailmail attribute of users, "email_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPmail
releaseCheck.urlRelease check URL (GitHub API URL; see values.yaml)null (disabled by default)
rqDefaultTimeoutMaximum execution time for background tasks, in seconds300 (5 minutes)
sessionCookieNameThe name to use for the session cookie"sessionid"
timeZoneThe time zone NetBox will use when dealing with dates and timesUTC
dateFormatDjango date format for long-form date strings"N j, Y"
shortDateFormatDjango date format for short-form date strings"Y-m-d"
timeFormatDjango date format for long-form time strings"g:i a"
shortTimeFormatDjango date format for short-form time strings"H:i:s"
dateTimeFormatDjango date format for long-form date and time strings"N j, Y g:i a"
shortDateTimeFormatDjango date format for short-form date and time strongs"Y-m-d H:i"
secretKeyDjango secret key used for sessions and password reset tokens"" (generated)
existingSecretUse an existing Kubernetes Secret for secret values (see below)"" (use individual chart values)
extraConfigAdditional NetBox configuration (see values.yaml)[]
postgresql.enabledDeploy PostgreSQL using bundled Bitnami PostgreSQL charttrue
postgresql.postgresqlUsernameUsername to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.postgresqlDatabaseDatabase to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.*Values under this key are passed to the bundled PostgreSQL chartn/a
externalDatabase.hostPostgreSQL host to use when postgresql.enabled is falselocalhost
externalDatabase.portPort number for external PostgreSQL5432
externalDatabase.databaseDatabase name for external PostgreSQLnetbox
externalDatabase.usernameUsername for external PostgreSQLnetbox
externalDatabase.passwordPassword for external PostgreSQL (see also existingSecret)""
externalDatabase.existingSecretNameFetch password for external PostgreSQL from a different Secret""
externalDatabase.existingSecretKeyKey to fetch the password in the above Secretpostgresql-password
externalDatabase.sslModePostgreSQL client SSL Mode settingprefer
externalDatabase.connMaxAgeThe lifetime of a database connection, as an integer of seconds300
redis.enabledDeploy Redis using bundled Bitnami Redis charttrue
redis.*Values under this key are passed to the bundled Redis chartn/a
tasksRedis.databaseRedis database number used for NetBox task queue0
tasksRedis.sslEnable SSL when connecting to Redisfalse
tasksRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
tasksRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
tasksRedis.portPort number for external Redis6379
tasksRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
tasksRedis.sentinelServiceSentinel master service name"netbox-redis"
tasksRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
tasksRedis.passwordPassword for external Redis (see also existingSecret)""
tasksRedis.existingSecretNameFetch password for external Redis from a different Secret""
tasksRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
cachingRedis.databaseRedis database number used for caching views1
cachingRedis.sslEnable SSL when connecting to Redisfalse
cachingRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
cachingRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
cachingRedis.portPort number for external Redis6379
cachingRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
cachingRedis.sentinelServiceSentinel master service name"netbox-redis"
cachingRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
cachingRedis.passwordPassword for external Redis (see also existingSecret)""
cachingRedis.existingSecretNameFetch password for external Redis from a different Secret""
cachingRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
imagePullSecretsList of Secret names containing private registry credentials[]
nameOverrideOverride the application name (netbox) used throughout the chart""
fullnameOverrideOverride the full name of resources created as part of the release""
serviceAccount.createCreate a ServiceAccount for NetBoxtrue
serviceAccount.annotationsAnnotations to add to the service account{}
serviceAccount.nameThe name of the service account to use"" (use the fullname)
persistence.enabledEnable storage persistence for uploaded media (images)true
persistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
persistence.subPathMount a sub-path of the volume into the container, not the root""
persistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
persistence.selectorSet the selector for PVs, if desired{}
persistence.accessModeAccess mode for the volumeReadWriteOnce
persistence.sizeSize of persistent volume to request1Gi
reportsPersistence.enabledEnable storage persistence for NetBox reportsfalse
reportsPersistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
reportsPersistence.subPathMount a sub-path of the volume into the container, not the root""
reportsPersistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
reportsPersistence.selectorSet the selector for PVs, if desired{}
reportsPersistence.accessModeAccess mode for the volumeReadWriteOnce
reportsPersistence.sizeSize of persistent volume to request1Gi
podAnnotationsAdditional annotations for NetBox pods{}
podLabelsAdditional labels for NetBox pods{}
podSecurityContextSecurity context for NetBox podssee values.yaml
securityContextSecurity context for NetBox containerssee values.yaml
service.typeType of Service resource to createClusterIP
service.portPort number for the service80
service.nodePortThe port used on the node when service.type is NodePort""
service.clusterIPThe cluster IP address assigned to the service""
service.clusterIPsA list of cluster IP addresses assigned to the service[]
service.externalIPsA list of external IP addresses aliased to this service[]
service.externalTrafficPolicyPolicy for routing external traffic""
service.ipFamilyPolicyRepresents the dual-stack-ness of the service""
service.loadBalancerIPRequest a specific IP address when service.type is LoadBalancer""
service.loadBalancerSourceRangesA list of allowed IP ranges when service.type is LoadBalancer[]
ingress.enabledCreate an Ingress resource for accessing NetBoxfalse
ingress.classNameUse a named IngressClass""
ingress.annotationsExtra annotations to apply to the Ingress resource{}
ingress.hostsList of hosts and paths to map to the service (see values.yaml)[{host:"chart-example.local",paths:["/"]}]
ingress.tlsTLS settings for the Ingress resource[]
resourcesConfigure resource requests or limits for NetBox{}
readinessProbe.enabledEnable Kubernetes readinessProbe, see readiness probessee values.yaml
readinessProbe.initialDelaySecondsNumber of secondssee values.yaml
readinessProbe.timeoutSecondsNumber of secondssee values.yaml
readinessProbe.periodSecondsNumber of secondssee values.yaml
readinessProbe.successThresholdNumber of secondssee values.yaml
init.image.repositoryInit container image repositorybusybox
init.image.tagInit container image tag1.32.1
init.image.pullPolicyInit container image pull policyIfNotPresent
init.resourcesConfigure resource requests or limits for init container{}
init.securityContextSecurity context for init containersee values.yaml
autoscaling.enabledWhether to enable the HorizontalPodAutoscalerfalse
autoscaling.minReplicasMinimum number of replicas when autoscaling is enabled1
autoscaling.maxReplicasMaximum number of replicas when autoscaling is enabled100
autoscaling.targetCPUUtilizationPercentageTarget CPU utilisation percentage for autoscaling80
autoscaling.targetMemoryUtilizationPercentageTarget memory utilisation percentage for autoscalingnull
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
updateStrategyConfigure deployment update strategy{} (defaults to RollingUpdate)
affinityAffinity settings for pod assignment{}
extraEnvsAdditional environment variables to set in the NetBox container[]
extraVolumeMountsAdditional volumes to mount in the NetBox container[]
extraVolumesAdditional volumes to reference in pods[]
extraContainersAdditional sidecar containers to be added to pods[]
extraInitContainersAdditional init containers to run before starting main containers[]
workerWorker specific variables. Most global variables also apply here.see values.yaml
housekeeping.enabledWhether the HousekeepingCronJob should be activetrue
housekeeping.concurrencyPolicyConcurrencyPolicy for the Housekeeping CronJob.Forbid
housekeeping.failedJobsHistoryLimitNumber of failed jobs to keep in history5
housekeeping.restartPolicyRestart Policy for the Housekeeping CronJob.OnFailure
housekeeping.scheduleSchedule for the CronJob in Cron syntax.0 0 * * * (Midnight daily)
housekeeping.successfulJobsHistoryLimitNumber of successful jobs to keep in history5
housekeeping.suspendWhether to suspend the CronJobfalse
housekeeping.podAnnotationsAdditional annotations for housekeeping CronJob pods{}
housekeeping.podLabelsAdditional labels for housekeeping CronJob pods{}
housekeeping.podSecurityContextSecurity context for housekeeping CronJob podssee values.yaml
housekeeping.securityContextSecurity context for housekeeping CronJob containerssee values.yaml
housekeeping.resourcesConfigure resource requests or limits for housekeeping CronJob{}
housekeeping.nodeSelectorNode labels for housekeeping CronJob pod assignment{}
housekeeping.tolerationsToleration labels for housekeeping CronJob pod assignment[]
housekeeping.affinityAffinity settings for housekeeping CronJob pod assignment{}
housekeeping.extraEnvsAdditional environment variables to set in housekeeping CronJob[]
housekeeping.extraVolumeMountsAdditional volumes to mount in the housekeeping CronJob[]
housekeeping.extraVolumesAdditional volumes to reference in housekeeping CronJob pods[]
housekeeping.extraContainersAdditional sidecar containers to be added to housekeeping CronJob[]
housekeeping.extraInitContainersAdditional init containers for housekeeping CronJob pods[]

Specify each parameter using the --set key=value[,key=value] argument to helm install or provide a YAML file containing the values for the above parameters:

$ helm install --name my-release bootc/netbox --values values.yaml

Using an Existing Secret

Rather than specifying passwords and secrets as part of the Helm release values, you may pass these to NetBox using a pre-existing Secret resource. When using this, the Secret must contain the following keys:

KeyDescriptionRequired?
db_passwordThe password for the external PostgreSQL databaseIf postgresql.enabled is false and externalDatabase.existingSecretName is unset
email_passwordSMTP user passwordYes, but the value may be left blank if not required
ldap_bind_passwordPassword for LDAP bind DNIf remoteAuth.enabled is true and remoteAuth.backend is netbox.authentication.LDAPBackend
napalm_passwordNAPALM user passwordYes, but the value may be left blank if not required
redis_tasks_passwordPassword for the external Redis tasks databaseIf redis.enabled is false and tasksRedis.existingSecretName is unset
redis_cache_passwordPassword for the external Redis cache databaseIf redis.enabled is false and cachingRedis.existingSecretName is unset
secret_keyDjango secret key used for sessions and password reset tokensYes
superuser_passwordPassword for the initial super-user accountYes
superuser_api_tokenAPI token created for the initial super-user accountYes

Using extraConfig for S3 storage configuration

If you want to use S3 as your storage backend and not have the config in the values.yaml (credentials!) you can use an existing secret that is then referenced under the extraConfig key.

The secret would look like this:

apiVersion: v1kind: Secretmetadata:
labels:
app.kubernetes.io/instance: netboxname: netbox-extrastringData:
s3-config.yaml: | STORAGE_CONFIG: AWS_S3_ENDPOINT_URL: <endpoint-URL> AWS_S3_REGION_NAME: <region> AWS_STORAGE_BUCKET_NAME: <bucket-name> AWS_ACCESS_KEY_ID: <access-key> AWS_SECRET_ACCESS_KEY: <secret-key>

And the secret then has to be referenced like this:

extraConfig:
- secret: # same as pod.spec.volumes.secretsecretName: netbox-extra

Configuring SSO

You can leverage the extraConfig value in conjunction with remoteAuth to configure SSO. An example:

remoteAuth:
enabled: truebackend: social_core.backends.keycloak.KeycloakOAuth2autoCreateUser: falseextraConfig:
- values:
SOCIAL_AUTH_KEYCLOAK_KEY: 'netbox'SOCIAL_AUTH_KEYCLOAK_SECRET: 'HaveANiceDay'SOCIAL_AUTH_KEYCLOAK_PUBLIC_KEY: 'MII....'SOCIAL_AUTH_KEYCLOAK_AUTHORIZATION_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/auth'SOCIAL_AUTH_KEYCLOAK_ACCESS_TOKEN_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/token'SOCIAL_AUTH_KEYCLOAK_ID_KEY: 'email'SOCIAL_AUTH_JSONFIELD_ENABLED: True

Using LDAP Authentication

In order to enable LDAP authentication, please carry out the following steps:

  1. Set image.tag in your values to an image with LDAP support (e.g. v3.0.11-ldap)
  2. Configure the remoteAuth settings to enable the LDAP backend (see below)
  3. Make sure you set all of the remoteAuth.ldap settings shown in the values.yaml file

For example:

remoteAuth:
enabled: truebackend: netbox.authentication.LDAPBackendldap:
serverUri: 'ldap://domain.com'startTls: trueignoreCertErrors: truebindDn: ''bindPassword: ''# and ALL the other remoteAuth.ldap.* settings from values.yaml

Note: in order to use anonymous LDAP binding set bindDn and bindPassword to an empty string as in the example above.

License

The following notice applies to all files contained within this Helm Chart and the Git repository which contains it:

Copyright 2019-2020 Chris Boot

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A Helm chart for NetBox

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - gesv/netbox-chart: A Helm chart for NetBox · GitHub
Skip to content

Repository files navigation

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 cacheTimeout and releaseCheck.timeout settings 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 netbox Deployment 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 webhooksRedis configuration key in values.yaml has been renamed to tasksRedis to match the upstream name
  • The redis_password key in the Secret has been renamed to redis_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.

ParameterDescriptionDefault
replicaCountThe desired number of NetBox pods1
image.repositoryNetBox container image repositorynetboxcommunity/netbox
image.tagNetBox container image tag""
image.pullPolicyNetBox container image pull policyIfNotPresent
superuser.nameInitial super-user account to createadmin
superuser.emailEmail address for the initial super-user accountadmin@example.com
superuser.passwordPassword for the initial super-user accountadmin
superuser.apiTokenAPI token created for the initial super-user account0123456789abcdef0123456789abcdef01234567
skipStartupScriptsSkip netbox-docker startup scriptstrue
allowedHostsList of valid FQDNs for this NetBox instance["*"]
adminsList of admins to email about critical errors[]
authPasswordValidatorsConfigure validation of local user account passwords[]
allowedUrlSchemesURL schemes that are allowed within links in NetBoxsee values.yaml
banner.topBanner text to display at the top of every page""
banner.bottomBanner text to display at the bottom of every page""
banner.loginBanner text to display on the login page""
basePathBase URL path if accessing NetBox within a directory""
changelogRetentionMaximum number of days to retain logged changes (0 = forever)90
customValidatorsCustom validators for NetBox field values{}
defaultUserPreferencesDefault preferences for newly created user accounts{}
cors.originAllowAllCORS: allow all originsfalse
cors.originWhitelistCORS: list of origins authorised to make cross-site HTTP requests[]
cors.originRegexWhitelistCORS: list of regex strings matching authorised origins[]
csrf.cookieNameName of the CSRF authentication cookiecsrftoken
csrf.trustedOriginsA list of trusted origins for unsafe (e.g. POST) requests[]
debugEnable NetBox debugging (NOT for production use)false
dbWaitDebugShow details of errors that occur when applying migrationsfalse
email.serverSMTP server to use to send emailslocalhost
email.portTCP port to connect to the SMTP server on25
email.usernameOptional username for SMTP authentication""
email.passwordPassword for SMTP authentication (see also existingSecret)""
email.useSSLUse SSL when connecting to the serverfalse
email.useTLSUse TLS when connecting to the serverfalse
email.sslCertFileSMTP SSL certificate file path (e.g. in a mounted volume)""
email.sslKeyFileSMTP SSL key file path (e.g. in a mounted volume)""
email.timeoutTimeout for SMTP connections, in seconds10
email.fromSender address for emails sent by NetBox""
enforceGlobalUniqueEnforce unique IP space in the global table (not in a VRF)false
exemptViewPermissionsA list of models to exempt from the enforcement of view permissions[]
fieldChoicesConfigure custom choices for certain built-in fields{}
graphQlEnabledEnable the GraphQL APItrue
httpProxiesHTTP proxies NetBox should use when sending outbound HTTP requestsnull
internalIPsIP addresses recognized as internal to the system['127.0.0.1', '::1']
jobResultRetentionThe number of days to retain job results (scripts and reports)90
loggingCustom Django logging configuration{}
loginPersistenceEnables users to remain authenticated to NetBox indefinitelyfalse
loginRequiredPermit only logged-in users to access NetBoxfalse (unauthenticated read-only access)
loginTimeoutHow often to re-authenticate users1209600 (14 days)
maintenanceModeDisplay a "maintenance mode" banner on every pagefalse
mapsUrlThe URL to use when mapping physical addresses or GPS coordinateshttps://maps.google.com/?q=
maxPageSizeMaximum number of objects that can be returned by a single API call1000
storageBackendDjango-storages backend class namenull
storageConfigDjango-storages backend configuration{}
metricsEnabledExpose Prometheus metrics at the /metrics HTTP endpointfalse
napalm.usernameUsername used by the NAPALM library to access network devices""
napalm.passwordPassword used by the NAPALM library (see also existingSecret)""
napalm.timeoutTimeout for NAPALM to connect to a device (in seconds)30
napalm.argsA dictionary of optional arguments to pass to NAPALM{}
paginateCountThe default number of objects to display per page in the web UI50
pluginsAdditional plugins to load into NetBox[]
pluginsConfigConfiguration for the additional plugins{}
powerFeedDefaultAmperageDefault amperage value for new power feeds15
powerFeedMaxUtilisationDefault maximum utilisation percentage for new power feeds80
powerFeedDefaultVoltageDefault voltage value for new power feeds120
preferIPv4Prefer devices' IPv4 address when determining their primary addressfalse
rackElevationDefaultUnitHeightRack elevation default height in pixels22
rackElevationDefaultUnitWidthRack elevation default width in pixels220
remoteAuth.enabledEnable remote authentication supportfalse
remoteAuth.backendRemote authentication backend classnetbox.authentication.RemoteUserBackend
remoteAuth.headerThe name of the HTTP header which conveys the usernameHTTP_REMOTE_USER
remoteAuth.autoCreateUserEnables the automatic creation of new userstrue
remoteAuth.defaultGroupsA list of groups to assign to newly created users[]
remoteAuth.defaultPermissionsA list of permissions to assign newly created users{}
remoteAuth.groupSyncEnabledSync remote user groups from an HTTP header set by a reverse proxyfalse
remoteAuth.groupHeaderThe name of the HTTP header which conveys the groups to which the user belongsHTTP_REMOTE_USER_GROUP
remoteAuth.superuserGroupsThe list of groups that promote an remote User to Superuser on login[]
remoteAuth.superusersThe list of users that get promoted to Superuser on login[]
remoteAuth.staffGroupsThe list of groups that promote an remote User to Staff on login[]
remoteAuth.staffUsersThe list of users that get promoted to Staff on login[]
remoteAuth.groupSeparatorThe Seperator upon which remoteAuth.groupHeader gets split into individual groups|
remoteAuth.ldap.serverUrisee django-auth-ldap""
remoteAuth.ldap.startTlsif StarTLS should be usedsee values.yaml
remoteAuth.ldap.ignoreCertErrorsif Certificate errors should be ignoredsee values.yaml
remoteAuth.ldap.bindDnDistinguished Name to bind with""
remoteAuth.ldap.bindPasswordPassword for bind DN""
remoteAuth.ldap.userDnTemplatesee AUTH_LDAP_USER_DN_TEMPLATEsee values.yaml
remoteAuth.ldap.userSearchBaseDnsee base_dn of django_auth_ldap.config.LDAPSearchsee values.yaml
remoteAuth.ldap.userSearchAttrUser attribute name for user searchsAMAccountName
remoteAuth.ldap.groupSearchBaseDnbase DN for group searchsee values.yaml
remoteAuth.ldap.groupSearchClassdjango-auth-ldap for group searchgroup
remoteAuth.ldap.groupTypesee AUTH_LDAP_GROUP_TYPEGroupOfNamesType
remoteAuth.ldap.requireGroupDnDN of a group that is required for loginnull
remoteAuth.ldap.findGroupPermssee AUTH_LDAP_FIND_GROUP_PERMStrue
remoteAuth.ldap.mirrorGroupssee AUTH_LDAP_MIRROR_GROUPSnull
remoteAuth.ldap.cacheTimeoutsee AUTH_LDAP_MIRROR_GROUPS_EXCEPTnull
remoteAuth.ldap.isAdminDnrequired DN to be able to login in Admin-Backend, "is_staff"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.isSuperUserDnrequired DN to receive SuperUser privileges, "is_superuser"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.attrFirstNamefirst name attribute of users, "first_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPgivenName
remoteAuth.ldap.attrLastNamelast name attribute of users, "last_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPsn
remoteAuth.ldap.attrMailmail attribute of users, "email_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPmail
releaseCheck.urlRelease check URL (GitHub API URL; see values.yaml)null (disabled by default)
rqDefaultTimeoutMaximum execution time for background tasks, in seconds300 (5 minutes)
sessionCookieNameThe name to use for the session cookie"sessionid"
timeZoneThe time zone NetBox will use when dealing with dates and timesUTC
dateFormatDjango date format for long-form date strings"N j, Y"
shortDateFormatDjango date format for short-form date strings"Y-m-d"
timeFormatDjango date format for long-form time strings"g:i a"
shortTimeFormatDjango date format for short-form time strings"H:i:s"
dateTimeFormatDjango date format for long-form date and time strings"N j, Y g:i a"
shortDateTimeFormatDjango date format for short-form date and time strongs"Y-m-d H:i"
secretKeyDjango secret key used for sessions and password reset tokens"" (generated)
existingSecretUse an existing Kubernetes Secret for secret values (see below)"" (use individual chart values)
extraConfigAdditional NetBox configuration (see values.yaml)[]
postgresql.enabledDeploy PostgreSQL using bundled Bitnami PostgreSQL charttrue
postgresql.postgresqlUsernameUsername to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.postgresqlDatabaseDatabase to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.*Values under this key are passed to the bundled PostgreSQL chartn/a
externalDatabase.hostPostgreSQL host to use when postgresql.enabled is falselocalhost
externalDatabase.portPort number for external PostgreSQL5432
externalDatabase.databaseDatabase name for external PostgreSQLnetbox
externalDatabase.usernameUsername for external PostgreSQLnetbox
externalDatabase.passwordPassword for external PostgreSQL (see also existingSecret)""
externalDatabase.existingSecretNameFetch password for external PostgreSQL from a different Secret""
externalDatabase.existingSecretKeyKey to fetch the password in the above Secretpostgresql-password
externalDatabase.sslModePostgreSQL client SSL Mode settingprefer
externalDatabase.connMaxAgeThe lifetime of a database connection, as an integer of seconds300
redis.enabledDeploy Redis using bundled Bitnami Redis charttrue
redis.*Values under this key are passed to the bundled Redis chartn/a
tasksRedis.databaseRedis database number used for NetBox task queue0
tasksRedis.sslEnable SSL when connecting to Redisfalse
tasksRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
tasksRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
tasksRedis.portPort number for external Redis6379
tasksRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
tasksRedis.sentinelServiceSentinel master service name"netbox-redis"
tasksRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
tasksRedis.passwordPassword for external Redis (see also existingSecret)""
tasksRedis.existingSecretNameFetch password for external Redis from a different Secret""
tasksRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
cachingRedis.databaseRedis database number used for caching views1
cachingRedis.sslEnable SSL when connecting to Redisfalse
cachingRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
cachingRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
cachingRedis.portPort number for external Redis6379
cachingRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
cachingRedis.sentinelServiceSentinel master service name"netbox-redis"
cachingRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
cachingRedis.passwordPassword for external Redis (see also existingSecret)""
cachingRedis.existingSecretNameFetch password for external Redis from a different Secret""
cachingRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
imagePullSecretsList of Secret names containing private registry credentials[]
nameOverrideOverride the application name (netbox) used throughout the chart""
fullnameOverrideOverride the full name of resources created as part of the release""
serviceAccount.createCreate a ServiceAccount for NetBoxtrue
serviceAccount.annotationsAnnotations to add to the service account{}
serviceAccount.nameThe name of the service account to use"" (use the fullname)
persistence.enabledEnable storage persistence for uploaded media (images)true
persistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
persistence.subPathMount a sub-path of the volume into the container, not the root""
persistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
persistence.selectorSet the selector for PVs, if desired{}
persistence.accessModeAccess mode for the volumeReadWriteOnce
persistence.sizeSize of persistent volume to request1Gi
reportsPersistence.enabledEnable storage persistence for NetBox reportsfalse
reportsPersistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
reportsPersistence.subPathMount a sub-path of the volume into the container, not the root""
reportsPersistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
reportsPersistence.selectorSet the selector for PVs, if desired{}
reportsPersistence.accessModeAccess mode for the volumeReadWriteOnce
reportsPersistence.sizeSize of persistent volume to request1Gi
podAnnotationsAdditional annotations for NetBox pods{}
podLabelsAdditional labels for NetBox pods{}
podSecurityContextSecurity context for NetBox podssee values.yaml
securityContextSecurity context for NetBox containerssee values.yaml
service.typeType of Service resource to createClusterIP
service.portPort number for the service80
service.nodePortThe port used on the node when service.type is NodePort""
service.clusterIPThe cluster IP address assigned to the service""
service.clusterIPsA list of cluster IP addresses assigned to the service[]
service.externalIPsA list of external IP addresses aliased to this service[]
service.externalTrafficPolicyPolicy for routing external traffic""
service.ipFamilyPolicyRepresents the dual-stack-ness of the service""
service.loadBalancerIPRequest a specific IP address when service.type is LoadBalancer""
service.loadBalancerSourceRangesA list of allowed IP ranges when service.type is LoadBalancer[]
ingress.enabledCreate an Ingress resource for accessing NetBoxfalse
ingress.classNameUse a named IngressClass""
ingress.annotationsExtra annotations to apply to the Ingress resource{}
ingress.hostsList of hosts and paths to map to the service (see values.yaml)[{host:"chart-example.local",paths:["/"]}]
ingress.tlsTLS settings for the Ingress resource[]
resourcesConfigure resource requests or limits for NetBox{}
readinessProbe.enabledEnable Kubernetes readinessProbe, see readiness probessee values.yaml
readinessProbe.initialDelaySecondsNumber of secondssee values.yaml
readinessProbe.timeoutSecondsNumber of secondssee values.yaml
readinessProbe.periodSecondsNumber of secondssee values.yaml
readinessProbe.successThresholdNumber of secondssee values.yaml
init.image.repositoryInit container image repositorybusybox
init.image.tagInit container image tag1.32.1
init.image.pullPolicyInit container image pull policyIfNotPresent
init.resourcesConfigure resource requests or limits for init container{}
init.securityContextSecurity context for init containersee values.yaml
autoscaling.enabledWhether to enable the HorizontalPodAutoscalerfalse
autoscaling.minReplicasMinimum number of replicas when autoscaling is enabled1
autoscaling.maxReplicasMaximum number of replicas when autoscaling is enabled100
autoscaling.targetCPUUtilizationPercentageTarget CPU utilisation percentage for autoscaling80
autoscaling.targetMemoryUtilizationPercentageTarget memory utilisation percentage for autoscalingnull
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
updateStrategyConfigure deployment update strategy{} (defaults to RollingUpdate)
affinityAffinity settings for pod assignment{}
extraEnvsAdditional environment variables to set in the NetBox container[]
extraVolumeMountsAdditional volumes to mount in the NetBox container[]
extraVolumesAdditional volumes to reference in pods[]
extraContainersAdditional sidecar containers to be added to pods[]
extraInitContainersAdditional init containers to run before starting main containers[]
workerWorker specific variables. Most global variables also apply here.see values.yaml
housekeeping.enabledWhether the HousekeepingCronJob should be activetrue
housekeeping.concurrencyPolicyConcurrencyPolicy for the Housekeeping CronJob.Forbid
housekeeping.failedJobsHistoryLimitNumber of failed jobs to keep in history5
housekeeping.restartPolicyRestart Policy for the Housekeeping CronJob.OnFailure
housekeeping.scheduleSchedule for the CronJob in Cron syntax.0 0 * * * (Midnight daily)
housekeeping.successfulJobsHistoryLimitNumber of successful jobs to keep in history5
housekeeping.suspendWhether to suspend the CronJobfalse
housekeeping.podAnnotationsAdditional annotations for housekeeping CronJob pods{}
housekeeping.podLabelsAdditional labels for housekeeping CronJob pods{}
housekeeping.podSecurityContextSecurity context for housekeeping CronJob podssee values.yaml
housekeeping.securityContextSecurity context for housekeeping CronJob containerssee values.yaml
housekeeping.resourcesConfigure resource requests or limits for housekeeping CronJob{}
housekeeping.nodeSelectorNode labels for housekeeping CronJob pod assignment{}
housekeeping.tolerationsToleration labels for housekeeping CronJob pod assignment[]
housekeeping.affinityAffinity settings for housekeeping CronJob pod assignment{}
housekeeping.extraEnvsAdditional environment variables to set in housekeeping CronJob[]
housekeeping.extraVolumeMountsAdditional volumes to mount in the housekeeping CronJob[]
housekeeping.extraVolumesAdditional volumes to reference in housekeeping CronJob pods[]
housekeeping.extraContainersAdditional sidecar containers to be added to housekeeping CronJob[]
housekeeping.extraInitContainersAdditional init containers for housekeeping CronJob pods[]

Specify each parameter using the --set key=value[,key=value] argument to helm install or provide a YAML file containing the values for the above parameters:

$ helm install --name my-release bootc/netbox --values values.yaml

Using an Existing Secret

Rather than specifying passwords and secrets as part of the Helm release values, you may pass these to NetBox using a pre-existing Secret resource. When using this, the Secret must contain the following keys:

KeyDescriptionRequired?
db_passwordThe password for the external PostgreSQL databaseIf postgresql.enabled is false and externalDatabase.existingSecretName is unset
email_passwordSMTP user passwordYes, but the value may be left blank if not required
ldap_bind_passwordPassword for LDAP bind DNIf remoteAuth.enabled is true and remoteAuth.backend is netbox.authentication.LDAPBackend
napalm_passwordNAPALM user passwordYes, but the value may be left blank if not required
redis_tasks_passwordPassword for the external Redis tasks databaseIf redis.enabled is false and tasksRedis.existingSecretName is unset
redis_cache_passwordPassword for the external Redis cache databaseIf redis.enabled is false and cachingRedis.existingSecretName is unset
secret_keyDjango secret key used for sessions and password reset tokensYes
superuser_passwordPassword for the initial super-user accountYes
superuser_api_tokenAPI token created for the initial super-user accountYes

Using extraConfig for S3 storage configuration

If you want to use S3 as your storage backend and not have the config in the values.yaml (credentials!) you can use an existing secret that is then referenced under the extraConfig key.

The secret would look like this:

apiVersion: v1kind: Secretmetadata:
labels:
app.kubernetes.io/instance: netboxname: netbox-extrastringData:
s3-config.yaml: | STORAGE_CONFIG: AWS_S3_ENDPOINT_URL: <endpoint-URL> AWS_S3_REGION_NAME: <region> AWS_STORAGE_BUCKET_NAME: <bucket-name> AWS_ACCESS_KEY_ID: <access-key> AWS_SECRET_ACCESS_KEY: <secret-key>

And the secret then has to be referenced like this:

extraConfig:
- secret: # same as pod.spec.volumes.secretsecretName: netbox-extra

Configuring SSO

You can leverage the extraConfig value in conjunction with remoteAuth to configure SSO. An example:

remoteAuth:
enabled: truebackend: social_core.backends.keycloak.KeycloakOAuth2autoCreateUser: falseextraConfig:
- values:
SOCIAL_AUTH_KEYCLOAK_KEY: 'netbox'SOCIAL_AUTH_KEYCLOAK_SECRET: 'HaveANiceDay'SOCIAL_AUTH_KEYCLOAK_PUBLIC_KEY: 'MII....'SOCIAL_AUTH_KEYCLOAK_AUTHORIZATION_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/auth'SOCIAL_AUTH_KEYCLOAK_ACCESS_TOKEN_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/token'SOCIAL_AUTH_KEYCLOAK_ID_KEY: 'email'SOCIAL_AUTH_JSONFIELD_ENABLED: True

Using LDAP Authentication

In order to enable LDAP authentication, please carry out the following steps:

  1. Set image.tag in your values to an image with LDAP support (e.g. v3.0.11-ldap)
  2. Configure the remoteAuth settings to enable the LDAP backend (see below)
  3. Make sure you set all of the remoteAuth.ldap settings shown in the values.yaml file

For example:

remoteAuth:
enabled: truebackend: netbox.authentication.LDAPBackendldap:
serverUri: 'ldap://domain.com'startTls: trueignoreCertErrors: truebindDn: ''bindPassword: ''# and ALL the other remoteAuth.ldap.* settings from values.yaml

Note: in order to use anonymous LDAP binding set bindDn and bindPassword to an empty string as in the example above.

License

The following notice applies to all files contained within this Helm Chart and the Git repository which contains it:

Copyright 2019-2020 Chris Boot

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A Helm chart for NetBox

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - gesv/netbox-chart: A Helm chart for NetBox · GitHub
Skip to content

Repository files navigation

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 cacheTimeout and releaseCheck.timeout settings 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 netbox Deployment 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 webhooksRedis configuration key in values.yaml has been renamed to tasksRedis to match the upstream name
  • The redis_password key in the Secret has been renamed to redis_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.

ParameterDescriptionDefault
replicaCountThe desired number of NetBox pods1
image.repositoryNetBox container image repositorynetboxcommunity/netbox
image.tagNetBox container image tag""
image.pullPolicyNetBox container image pull policyIfNotPresent
superuser.nameInitial super-user account to createadmin
superuser.emailEmail address for the initial super-user accountadmin@example.com
superuser.passwordPassword for the initial super-user accountadmin
superuser.apiTokenAPI token created for the initial super-user account0123456789abcdef0123456789abcdef01234567
skipStartupScriptsSkip netbox-docker startup scriptstrue
allowedHostsList of valid FQDNs for this NetBox instance["*"]
adminsList of admins to email about critical errors[]
authPasswordValidatorsConfigure validation of local user account passwords[]
allowedUrlSchemesURL schemes that are allowed within links in NetBoxsee values.yaml
banner.topBanner text to display at the top of every page""
banner.bottomBanner text to display at the bottom of every page""
banner.loginBanner text to display on the login page""
basePathBase URL path if accessing NetBox within a directory""
changelogRetentionMaximum number of days to retain logged changes (0 = forever)90
customValidatorsCustom validators for NetBox field values{}
defaultUserPreferencesDefault preferences for newly created user accounts{}
cors.originAllowAllCORS: allow all originsfalse
cors.originWhitelistCORS: list of origins authorised to make cross-site HTTP requests[]
cors.originRegexWhitelistCORS: list of regex strings matching authorised origins[]
csrf.cookieNameName of the CSRF authentication cookiecsrftoken
csrf.trustedOriginsA list of trusted origins for unsafe (e.g. POST) requests[]
debugEnable NetBox debugging (NOT for production use)false
dbWaitDebugShow details of errors that occur when applying migrationsfalse
email.serverSMTP server to use to send emailslocalhost
email.portTCP port to connect to the SMTP server on25
email.usernameOptional username for SMTP authentication""
email.passwordPassword for SMTP authentication (see also existingSecret)""
email.useSSLUse SSL when connecting to the serverfalse
email.useTLSUse TLS when connecting to the serverfalse
email.sslCertFileSMTP SSL certificate file path (e.g. in a mounted volume)""
email.sslKeyFileSMTP SSL key file path (e.g. in a mounted volume)""
email.timeoutTimeout for SMTP connections, in seconds10
email.fromSender address for emails sent by NetBox""
enforceGlobalUniqueEnforce unique IP space in the global table (not in a VRF)false
exemptViewPermissionsA list of models to exempt from the enforcement of view permissions[]
fieldChoicesConfigure custom choices for certain built-in fields{}
graphQlEnabledEnable the GraphQL APItrue
httpProxiesHTTP proxies NetBox should use when sending outbound HTTP requestsnull
internalIPsIP addresses recognized as internal to the system['127.0.0.1', '::1']
jobResultRetentionThe number of days to retain job results (scripts and reports)90
loggingCustom Django logging configuration{}
loginPersistenceEnables users to remain authenticated to NetBox indefinitelyfalse
loginRequiredPermit only logged-in users to access NetBoxfalse (unauthenticated read-only access)
loginTimeoutHow often to re-authenticate users1209600 (14 days)
maintenanceModeDisplay a "maintenance mode" banner on every pagefalse
mapsUrlThe URL to use when mapping physical addresses or GPS coordinateshttps://maps.google.com/?q=
maxPageSizeMaximum number of objects that can be returned by a single API call1000
storageBackendDjango-storages backend class namenull
storageConfigDjango-storages backend configuration{}
metricsEnabledExpose Prometheus metrics at the /metrics HTTP endpointfalse
napalm.usernameUsername used by the NAPALM library to access network devices""
napalm.passwordPassword used by the NAPALM library (see also existingSecret)""
napalm.timeoutTimeout for NAPALM to connect to a device (in seconds)30
napalm.argsA dictionary of optional arguments to pass to NAPALM{}
paginateCountThe default number of objects to display per page in the web UI50
pluginsAdditional plugins to load into NetBox[]
pluginsConfigConfiguration for the additional plugins{}
powerFeedDefaultAmperageDefault amperage value for new power feeds15
powerFeedMaxUtilisationDefault maximum utilisation percentage for new power feeds80
powerFeedDefaultVoltageDefault voltage value for new power feeds120
preferIPv4Prefer devices' IPv4 address when determining their primary addressfalse
rackElevationDefaultUnitHeightRack elevation default height in pixels22
rackElevationDefaultUnitWidthRack elevation default width in pixels220
remoteAuth.enabledEnable remote authentication supportfalse
remoteAuth.backendRemote authentication backend classnetbox.authentication.RemoteUserBackend
remoteAuth.headerThe name of the HTTP header which conveys the usernameHTTP_REMOTE_USER
remoteAuth.autoCreateUserEnables the automatic creation of new userstrue
remoteAuth.defaultGroupsA list of groups to assign to newly created users[]
remoteAuth.defaultPermissionsA list of permissions to assign newly created users{}
remoteAuth.groupSyncEnabledSync remote user groups from an HTTP header set by a reverse proxyfalse
remoteAuth.groupHeaderThe name of the HTTP header which conveys the groups to which the user belongsHTTP_REMOTE_USER_GROUP
remoteAuth.superuserGroupsThe list of groups that promote an remote User to Superuser on login[]
remoteAuth.superusersThe list of users that get promoted to Superuser on login[]
remoteAuth.staffGroupsThe list of groups that promote an remote User to Staff on login[]
remoteAuth.staffUsersThe list of users that get promoted to Staff on login[]
remoteAuth.groupSeparatorThe Seperator upon which remoteAuth.groupHeader gets split into individual groups|
remoteAuth.ldap.serverUrisee django-auth-ldap""
remoteAuth.ldap.startTlsif StarTLS should be usedsee values.yaml
remoteAuth.ldap.ignoreCertErrorsif Certificate errors should be ignoredsee values.yaml
remoteAuth.ldap.bindDnDistinguished Name to bind with""
remoteAuth.ldap.bindPasswordPassword for bind DN""
remoteAuth.ldap.userDnTemplatesee AUTH_LDAP_USER_DN_TEMPLATEsee values.yaml
remoteAuth.ldap.userSearchBaseDnsee base_dn of django_auth_ldap.config.LDAPSearchsee values.yaml
remoteAuth.ldap.userSearchAttrUser attribute name for user searchsAMAccountName
remoteAuth.ldap.groupSearchBaseDnbase DN for group searchsee values.yaml
remoteAuth.ldap.groupSearchClassdjango-auth-ldap for group searchgroup
remoteAuth.ldap.groupTypesee AUTH_LDAP_GROUP_TYPEGroupOfNamesType
remoteAuth.ldap.requireGroupDnDN of a group that is required for loginnull
remoteAuth.ldap.findGroupPermssee AUTH_LDAP_FIND_GROUP_PERMStrue
remoteAuth.ldap.mirrorGroupssee AUTH_LDAP_MIRROR_GROUPSnull
remoteAuth.ldap.cacheTimeoutsee AUTH_LDAP_MIRROR_GROUPS_EXCEPTnull
remoteAuth.ldap.isAdminDnrequired DN to be able to login in Admin-Backend, "is_staff"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.isSuperUserDnrequired DN to receive SuperUser privileges, "is_superuser"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.attrFirstNamefirst name attribute of users, "first_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPgivenName
remoteAuth.ldap.attrLastNamelast name attribute of users, "last_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPsn
remoteAuth.ldap.attrMailmail attribute of users, "email_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPmail
releaseCheck.urlRelease check URL (GitHub API URL; see values.yaml)null (disabled by default)
rqDefaultTimeoutMaximum execution time for background tasks, in seconds300 (5 minutes)
sessionCookieNameThe name to use for the session cookie"sessionid"
timeZoneThe time zone NetBox will use when dealing with dates and timesUTC
dateFormatDjango date format for long-form date strings"N j, Y"
shortDateFormatDjango date format for short-form date strings"Y-m-d"
timeFormatDjango date format for long-form time strings"g:i a"
shortTimeFormatDjango date format for short-form time strings"H:i:s"
dateTimeFormatDjango date format for long-form date and time strings"N j, Y g:i a"
shortDateTimeFormatDjango date format for short-form date and time strongs"Y-m-d H:i"
secretKeyDjango secret key used for sessions and password reset tokens"" (generated)
existingSecretUse an existing Kubernetes Secret for secret values (see below)"" (use individual chart values)
extraConfigAdditional NetBox configuration (see values.yaml)[]
postgresql.enabledDeploy PostgreSQL using bundled Bitnami PostgreSQL charttrue
postgresql.postgresqlUsernameUsername to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.postgresqlDatabaseDatabase to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.*Values under this key are passed to the bundled PostgreSQL chartn/a
externalDatabase.hostPostgreSQL host to use when postgresql.enabled is falselocalhost
externalDatabase.portPort number for external PostgreSQL5432
externalDatabase.databaseDatabase name for external PostgreSQLnetbox
externalDatabase.usernameUsername for external PostgreSQLnetbox
externalDatabase.passwordPassword for external PostgreSQL (see also existingSecret)""
externalDatabase.existingSecretNameFetch password for external PostgreSQL from a different Secret""
externalDatabase.existingSecretKeyKey to fetch the password in the above Secretpostgresql-password
externalDatabase.sslModePostgreSQL client SSL Mode settingprefer
externalDatabase.connMaxAgeThe lifetime of a database connection, as an integer of seconds300
redis.enabledDeploy Redis using bundled Bitnami Redis charttrue
redis.*Values under this key are passed to the bundled Redis chartn/a
tasksRedis.databaseRedis database number used for NetBox task queue0
tasksRedis.sslEnable SSL when connecting to Redisfalse
tasksRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
tasksRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
tasksRedis.portPort number for external Redis6379
tasksRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
tasksRedis.sentinelServiceSentinel master service name"netbox-redis"
tasksRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
tasksRedis.passwordPassword for external Redis (see also existingSecret)""
tasksRedis.existingSecretNameFetch password for external Redis from a different Secret""
tasksRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
cachingRedis.databaseRedis database number used for caching views1
cachingRedis.sslEnable SSL when connecting to Redisfalse
cachingRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
cachingRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
cachingRedis.portPort number for external Redis6379
cachingRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
cachingRedis.sentinelServiceSentinel master service name"netbox-redis"
cachingRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
cachingRedis.passwordPassword for external Redis (see also existingSecret)""
cachingRedis.existingSecretNameFetch password for external Redis from a different Secret""
cachingRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
imagePullSecretsList of Secret names containing private registry credentials[]
nameOverrideOverride the application name (netbox) used throughout the chart""
fullnameOverrideOverride the full name of resources created as part of the release""
serviceAccount.createCreate a ServiceAccount for NetBoxtrue
serviceAccount.annotationsAnnotations to add to the service account{}
serviceAccount.nameThe name of the service account to use"" (use the fullname)
persistence.enabledEnable storage persistence for uploaded media (images)true
persistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
persistence.subPathMount a sub-path of the volume into the container, not the root""
persistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
persistence.selectorSet the selector for PVs, if desired{}
persistence.accessModeAccess mode for the volumeReadWriteOnce
persistence.sizeSize of persistent volume to request1Gi
reportsPersistence.enabledEnable storage persistence for NetBox reportsfalse
reportsPersistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
reportsPersistence.subPathMount a sub-path of the volume into the container, not the root""
reportsPersistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
reportsPersistence.selectorSet the selector for PVs, if desired{}
reportsPersistence.accessModeAccess mode for the volumeReadWriteOnce
reportsPersistence.sizeSize of persistent volume to request1Gi
podAnnotationsAdditional annotations for NetBox pods{}
podLabelsAdditional labels for NetBox pods{}
podSecurityContextSecurity context for NetBox podssee values.yaml
securityContextSecurity context for NetBox containerssee values.yaml
service.typeType of Service resource to createClusterIP
service.portPort number for the service80
service.nodePortThe port used on the node when service.type is NodePort""
service.clusterIPThe cluster IP address assigned to the service""
service.clusterIPsA list of cluster IP addresses assigned to the service[]
service.externalIPsA list of external IP addresses aliased to this service[]
service.externalTrafficPolicyPolicy for routing external traffic""
service.ipFamilyPolicyRepresents the dual-stack-ness of the service""
service.loadBalancerIPRequest a specific IP address when service.type is LoadBalancer""
service.loadBalancerSourceRangesA list of allowed IP ranges when service.type is LoadBalancer[]
ingress.enabledCreate an Ingress resource for accessing NetBoxfalse
ingress.classNameUse a named IngressClass""
ingress.annotationsExtra annotations to apply to the Ingress resource{}
ingress.hostsList of hosts and paths to map to the service (see values.yaml)[{host:"chart-example.local",paths:["/"]}]
ingress.tlsTLS settings for the Ingress resource[]
resourcesConfigure resource requests or limits for NetBox{}
readinessProbe.enabledEnable Kubernetes readinessProbe, see readiness probessee values.yaml
readinessProbe.initialDelaySecondsNumber of secondssee values.yaml
readinessProbe.timeoutSecondsNumber of secondssee values.yaml
readinessProbe.periodSecondsNumber of secondssee values.yaml
readinessProbe.successThresholdNumber of secondssee values.yaml
init.image.repositoryInit container image repositorybusybox
init.image.tagInit container image tag1.32.1
init.image.pullPolicyInit container image pull policyIfNotPresent
init.resourcesConfigure resource requests or limits for init container{}
init.securityContextSecurity context for init containersee values.yaml
autoscaling.enabledWhether to enable the HorizontalPodAutoscalerfalse
autoscaling.minReplicasMinimum number of replicas when autoscaling is enabled1
autoscaling.maxReplicasMaximum number of replicas when autoscaling is enabled100
autoscaling.targetCPUUtilizationPercentageTarget CPU utilisation percentage for autoscaling80
autoscaling.targetMemoryUtilizationPercentageTarget memory utilisation percentage for autoscalingnull
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
updateStrategyConfigure deployment update strategy{} (defaults to RollingUpdate)
affinityAffinity settings for pod assignment{}
extraEnvsAdditional environment variables to set in the NetBox container[]
extraVolumeMountsAdditional volumes to mount in the NetBox container[]
extraVolumesAdditional volumes to reference in pods[]
extraContainersAdditional sidecar containers to be added to pods[]
extraInitContainersAdditional init containers to run before starting main containers[]
workerWorker specific variables. Most global variables also apply here.see values.yaml
housekeeping.enabledWhether the HousekeepingCronJob should be activetrue
housekeeping.concurrencyPolicyConcurrencyPolicy for the Housekeeping CronJob.Forbid
housekeeping.failedJobsHistoryLimitNumber of failed jobs to keep in history5
housekeeping.restartPolicyRestart Policy for the Housekeeping CronJob.OnFailure
housekeeping.scheduleSchedule for the CronJob in Cron syntax.0 0 * * * (Midnight daily)
housekeeping.successfulJobsHistoryLimitNumber of successful jobs to keep in history5
housekeeping.suspendWhether to suspend the CronJobfalse
housekeeping.podAnnotationsAdditional annotations for housekeeping CronJob pods{}
housekeeping.podLabelsAdditional labels for housekeeping CronJob pods{}
housekeeping.podSecurityContextSecurity context for housekeeping CronJob podssee values.yaml
housekeeping.securityContextSecurity context for housekeeping CronJob containerssee values.yaml
housekeeping.resourcesConfigure resource requests or limits for housekeeping CronJob{}
housekeeping.nodeSelectorNode labels for housekeeping CronJob pod assignment{}
housekeeping.tolerationsToleration labels for housekeeping CronJob pod assignment[]
housekeeping.affinityAffinity settings for housekeeping CronJob pod assignment{}
housekeeping.extraEnvsAdditional environment variables to set in housekeeping CronJob[]
housekeeping.extraVolumeMountsAdditional volumes to mount in the housekeeping CronJob[]
housekeeping.extraVolumesAdditional volumes to reference in housekeeping CronJob pods[]
housekeeping.extraContainersAdditional sidecar containers to be added to housekeeping CronJob[]
housekeeping.extraInitContainersAdditional init containers for housekeeping CronJob pods[]

Specify each parameter using the --set key=value[,key=value] argument to helm install or provide a YAML file containing the values for the above parameters:

$ helm install --name my-release bootc/netbox --values values.yaml

Using an Existing Secret

Rather than specifying passwords and secrets as part of the Helm release values, you may pass these to NetBox using a pre-existing Secret resource. When using this, the Secret must contain the following keys:

KeyDescriptionRequired?
db_passwordThe password for the external PostgreSQL databaseIf postgresql.enabled is false and externalDatabase.existingSecretName is unset
email_passwordSMTP user passwordYes, but the value may be left blank if not required
ldap_bind_passwordPassword for LDAP bind DNIf remoteAuth.enabled is true and remoteAuth.backend is netbox.authentication.LDAPBackend
napalm_passwordNAPALM user passwordYes, but the value may be left blank if not required
redis_tasks_passwordPassword for the external Redis tasks databaseIf redis.enabled is false and tasksRedis.existingSecretName is unset
redis_cache_passwordPassword for the external Redis cache databaseIf redis.enabled is false and cachingRedis.existingSecretName is unset
secret_keyDjango secret key used for sessions and password reset tokensYes
superuser_passwordPassword for the initial super-user accountYes
superuser_api_tokenAPI token created for the initial super-user accountYes

Using extraConfig for S3 storage configuration

If you want to use S3 as your storage backend and not have the config in the values.yaml (credentials!) you can use an existing secret that is then referenced under the extraConfig key.

The secret would look like this:

apiVersion: v1kind: Secretmetadata:
labels:
app.kubernetes.io/instance: netboxname: netbox-extrastringData:
s3-config.yaml: | STORAGE_CONFIG: AWS_S3_ENDPOINT_URL: <endpoint-URL> AWS_S3_REGION_NAME: <region> AWS_STORAGE_BUCKET_NAME: <bucket-name> AWS_ACCESS_KEY_ID: <access-key> AWS_SECRET_ACCESS_KEY: <secret-key>

And the secret then has to be referenced like this:

extraConfig:
- secret: # same as pod.spec.volumes.secretsecretName: netbox-extra

Configuring SSO

You can leverage the extraConfig value in conjunction with remoteAuth to configure SSO. An example:

remoteAuth:
enabled: truebackend: social_core.backends.keycloak.KeycloakOAuth2autoCreateUser: falseextraConfig:
- values:
SOCIAL_AUTH_KEYCLOAK_KEY: 'netbox'SOCIAL_AUTH_KEYCLOAK_SECRET: 'HaveANiceDay'SOCIAL_AUTH_KEYCLOAK_PUBLIC_KEY: 'MII....'SOCIAL_AUTH_KEYCLOAK_AUTHORIZATION_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/auth'SOCIAL_AUTH_KEYCLOAK_ACCESS_TOKEN_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/token'SOCIAL_AUTH_KEYCLOAK_ID_KEY: 'email'SOCIAL_AUTH_JSONFIELD_ENABLED: True

Using LDAP Authentication

In order to enable LDAP authentication, please carry out the following steps:

  1. Set image.tag in your values to an image with LDAP support (e.g. v3.0.11-ldap)
  2. Configure the remoteAuth settings to enable the LDAP backend (see below)
  3. Make sure you set all of the remoteAuth.ldap settings shown in the values.yaml file

For example:

remoteAuth:
enabled: truebackend: netbox.authentication.LDAPBackendldap:
serverUri: 'ldap://domain.com'startTls: trueignoreCertErrors: truebindDn: ''bindPassword: ''# and ALL the other remoteAuth.ldap.* settings from values.yaml

Note: in order to use anonymous LDAP binding set bindDn and bindPassword to an empty string as in the example above.

License

The following notice applies to all files contained within this Helm Chart and the Git repository which contains it:

Copyright 2019-2020 Chris Boot

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A Helm chart for NetBox

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - gesv/netbox-chart: A Helm chart for NetBox · GitHub
Skip to content

Repository files navigation

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 cacheTimeout and releaseCheck.timeout settings 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 netbox Deployment 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 webhooksRedis configuration key in values.yaml has been renamed to tasksRedis to match the upstream name
  • The redis_password key in the Secret has been renamed to redis_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.

ParameterDescriptionDefault
replicaCountThe desired number of NetBox pods1
image.repositoryNetBox container image repositorynetboxcommunity/netbox
image.tagNetBox container image tag""
image.pullPolicyNetBox container image pull policyIfNotPresent
superuser.nameInitial super-user account to createadmin
superuser.emailEmail address for the initial super-user accountadmin@example.com
superuser.passwordPassword for the initial super-user accountadmin
superuser.apiTokenAPI token created for the initial super-user account0123456789abcdef0123456789abcdef01234567
skipStartupScriptsSkip netbox-docker startup scriptstrue
allowedHostsList of valid FQDNs for this NetBox instance["*"]
adminsList of admins to email about critical errors[]
authPasswordValidatorsConfigure validation of local user account passwords[]
allowedUrlSchemesURL schemes that are allowed within links in NetBoxsee values.yaml
banner.topBanner text to display at the top of every page""
banner.bottomBanner text to display at the bottom of every page""
banner.loginBanner text to display on the login page""
basePathBase URL path if accessing NetBox within a directory""
changelogRetentionMaximum number of days to retain logged changes (0 = forever)90
customValidatorsCustom validators for NetBox field values{}
defaultUserPreferencesDefault preferences for newly created user accounts{}
cors.originAllowAllCORS: allow all originsfalse
cors.originWhitelistCORS: list of origins authorised to make cross-site HTTP requests[]
cors.originRegexWhitelistCORS: list of regex strings matching authorised origins[]
csrf.cookieNameName of the CSRF authentication cookiecsrftoken
csrf.trustedOriginsA list of trusted origins for unsafe (e.g. POST) requests[]
debugEnable NetBox debugging (NOT for production use)false
dbWaitDebugShow details of errors that occur when applying migrationsfalse
email.serverSMTP server to use to send emailslocalhost
email.portTCP port to connect to the SMTP server on25
email.usernameOptional username for SMTP authentication""
email.passwordPassword for SMTP authentication (see also existingSecret)""
email.useSSLUse SSL when connecting to the serverfalse
email.useTLSUse TLS when connecting to the serverfalse
email.sslCertFileSMTP SSL certificate file path (e.g. in a mounted volume)""
email.sslKeyFileSMTP SSL key file path (e.g. in a mounted volume)""
email.timeoutTimeout for SMTP connections, in seconds10
email.fromSender address for emails sent by NetBox""
enforceGlobalUniqueEnforce unique IP space in the global table (not in a VRF)false
exemptViewPermissionsA list of models to exempt from the enforcement of view permissions[]
fieldChoicesConfigure custom choices for certain built-in fields{}
graphQlEnabledEnable the GraphQL APItrue
httpProxiesHTTP proxies NetBox should use when sending outbound HTTP requestsnull
internalIPsIP addresses recognized as internal to the system['127.0.0.1', '::1']
jobResultRetentionThe number of days to retain job results (scripts and reports)90
loggingCustom Django logging configuration{}
loginPersistenceEnables users to remain authenticated to NetBox indefinitelyfalse
loginRequiredPermit only logged-in users to access NetBoxfalse (unauthenticated read-only access)
loginTimeoutHow often to re-authenticate users1209600 (14 days)
maintenanceModeDisplay a "maintenance mode" banner on every pagefalse
mapsUrlThe URL to use when mapping physical addresses or GPS coordinateshttps://maps.google.com/?q=
maxPageSizeMaximum number of objects that can be returned by a single API call1000
storageBackendDjango-storages backend class namenull
storageConfigDjango-storages backend configuration{}
metricsEnabledExpose Prometheus metrics at the /metrics HTTP endpointfalse
napalm.usernameUsername used by the NAPALM library to access network devices""
napalm.passwordPassword used by the NAPALM library (see also existingSecret)""
napalm.timeoutTimeout for NAPALM to connect to a device (in seconds)30
napalm.argsA dictionary of optional arguments to pass to NAPALM{}
paginateCountThe default number of objects to display per page in the web UI50
pluginsAdditional plugins to load into NetBox[]
pluginsConfigConfiguration for the additional plugins{}
powerFeedDefaultAmperageDefault amperage value for new power feeds15
powerFeedMaxUtilisationDefault maximum utilisation percentage for new power feeds80
powerFeedDefaultVoltageDefault voltage value for new power feeds120
preferIPv4Prefer devices' IPv4 address when determining their primary addressfalse
rackElevationDefaultUnitHeightRack elevation default height in pixels22
rackElevationDefaultUnitWidthRack elevation default width in pixels220
remoteAuth.enabledEnable remote authentication supportfalse
remoteAuth.backendRemote authentication backend classnetbox.authentication.RemoteUserBackend
remoteAuth.headerThe name of the HTTP header which conveys the usernameHTTP_REMOTE_USER
remoteAuth.autoCreateUserEnables the automatic creation of new userstrue
remoteAuth.defaultGroupsA list of groups to assign to newly created users[]
remoteAuth.defaultPermissionsA list of permissions to assign newly created users{}
remoteAuth.groupSyncEnabledSync remote user groups from an HTTP header set by a reverse proxyfalse
remoteAuth.groupHeaderThe name of the HTTP header which conveys the groups to which the user belongsHTTP_REMOTE_USER_GROUP
remoteAuth.superuserGroupsThe list of groups that promote an remote User to Superuser on login[]
remoteAuth.superusersThe list of users that get promoted to Superuser on login[]
remoteAuth.staffGroupsThe list of groups that promote an remote User to Staff on login[]
remoteAuth.staffUsersThe list of users that get promoted to Staff on login[]
remoteAuth.groupSeparatorThe Seperator upon which remoteAuth.groupHeader gets split into individual groups|
remoteAuth.ldap.serverUrisee django-auth-ldap""
remoteAuth.ldap.startTlsif StarTLS should be usedsee values.yaml
remoteAuth.ldap.ignoreCertErrorsif Certificate errors should be ignoredsee values.yaml
remoteAuth.ldap.bindDnDistinguished Name to bind with""
remoteAuth.ldap.bindPasswordPassword for bind DN""
remoteAuth.ldap.userDnTemplatesee AUTH_LDAP_USER_DN_TEMPLATEsee values.yaml
remoteAuth.ldap.userSearchBaseDnsee base_dn of django_auth_ldap.config.LDAPSearchsee values.yaml
remoteAuth.ldap.userSearchAttrUser attribute name for user searchsAMAccountName
remoteAuth.ldap.groupSearchBaseDnbase DN for group searchsee values.yaml
remoteAuth.ldap.groupSearchClassdjango-auth-ldap for group searchgroup
remoteAuth.ldap.groupTypesee AUTH_LDAP_GROUP_TYPEGroupOfNamesType
remoteAuth.ldap.requireGroupDnDN of a group that is required for loginnull
remoteAuth.ldap.findGroupPermssee AUTH_LDAP_FIND_GROUP_PERMStrue
remoteAuth.ldap.mirrorGroupssee AUTH_LDAP_MIRROR_GROUPSnull
remoteAuth.ldap.cacheTimeoutsee AUTH_LDAP_MIRROR_GROUPS_EXCEPTnull
remoteAuth.ldap.isAdminDnrequired DN to be able to login in Admin-Backend, "is_staff"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.isSuperUserDnrequired DN to receive SuperUser privileges, "is_superuser"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.attrFirstNamefirst name attribute of users, "first_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPgivenName
remoteAuth.ldap.attrLastNamelast name attribute of users, "last_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPsn
remoteAuth.ldap.attrMailmail attribute of users, "email_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPmail
releaseCheck.urlRelease check URL (GitHub API URL; see values.yaml)null (disabled by default)
rqDefaultTimeoutMaximum execution time for background tasks, in seconds300 (5 minutes)
sessionCookieNameThe name to use for the session cookie"sessionid"
timeZoneThe time zone NetBox will use when dealing with dates and timesUTC
dateFormatDjango date format for long-form date strings"N j, Y"
shortDateFormatDjango date format for short-form date strings"Y-m-d"
timeFormatDjango date format for long-form time strings"g:i a"
shortTimeFormatDjango date format for short-form time strings"H:i:s"
dateTimeFormatDjango date format for long-form date and time strings"N j, Y g:i a"
shortDateTimeFormatDjango date format for short-form date and time strongs"Y-m-d H:i"
secretKeyDjango secret key used for sessions and password reset tokens"" (generated)
existingSecretUse an existing Kubernetes Secret for secret values (see below)"" (use individual chart values)
extraConfigAdditional NetBox configuration (see values.yaml)[]
postgresql.enabledDeploy PostgreSQL using bundled Bitnami PostgreSQL charttrue
postgresql.postgresqlUsernameUsername to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.postgresqlDatabaseDatabase to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.*Values under this key are passed to the bundled PostgreSQL chartn/a
externalDatabase.hostPostgreSQL host to use when postgresql.enabled is falselocalhost
externalDatabase.portPort number for external PostgreSQL5432
externalDatabase.databaseDatabase name for external PostgreSQLnetbox
externalDatabase.usernameUsername for external PostgreSQLnetbox
externalDatabase.passwordPassword for external PostgreSQL (see also existingSecret)""
externalDatabase.existingSecretNameFetch password for external PostgreSQL from a different Secret""
externalDatabase.existingSecretKeyKey to fetch the password in the above Secretpostgresql-password
externalDatabase.sslModePostgreSQL client SSL Mode settingprefer
externalDatabase.connMaxAgeThe lifetime of a database connection, as an integer of seconds300
redis.enabledDeploy Redis using bundled Bitnami Redis charttrue
redis.*Values under this key are passed to the bundled Redis chartn/a
tasksRedis.databaseRedis database number used for NetBox task queue0
tasksRedis.sslEnable SSL when connecting to Redisfalse
tasksRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
tasksRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
tasksRedis.portPort number for external Redis6379
tasksRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
tasksRedis.sentinelServiceSentinel master service name"netbox-redis"
tasksRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
tasksRedis.passwordPassword for external Redis (see also existingSecret)""
tasksRedis.existingSecretNameFetch password for external Redis from a different Secret""
tasksRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
cachingRedis.databaseRedis database number used for caching views1
cachingRedis.sslEnable SSL when connecting to Redisfalse
cachingRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
cachingRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
cachingRedis.portPort number for external Redis6379
cachingRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
cachingRedis.sentinelServiceSentinel master service name"netbox-redis"
cachingRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
cachingRedis.passwordPassword for external Redis (see also existingSecret)""
cachingRedis.existingSecretNameFetch password for external Redis from a different Secret""
cachingRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
imagePullSecretsList of Secret names containing private registry credentials[]
nameOverrideOverride the application name (netbox) used throughout the chart""
fullnameOverrideOverride the full name of resources created as part of the release""
serviceAccount.createCreate a ServiceAccount for NetBoxtrue
serviceAccount.annotationsAnnotations to add to the service account{}
serviceAccount.nameThe name of the service account to use"" (use the fullname)
persistence.enabledEnable storage persistence for uploaded media (images)true
persistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
persistence.subPathMount a sub-path of the volume into the container, not the root""
persistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
persistence.selectorSet the selector for PVs, if desired{}
persistence.accessModeAccess mode for the volumeReadWriteOnce
persistence.sizeSize of persistent volume to request1Gi
reportsPersistence.enabledEnable storage persistence for NetBox reportsfalse
reportsPersistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
reportsPersistence.subPathMount a sub-path of the volume into the container, not the root""
reportsPersistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
reportsPersistence.selectorSet the selector for PVs, if desired{}
reportsPersistence.accessModeAccess mode for the volumeReadWriteOnce
reportsPersistence.sizeSize of persistent volume to request1Gi
podAnnotationsAdditional annotations for NetBox pods{}
podLabelsAdditional labels for NetBox pods{}
podSecurityContextSecurity context for NetBox podssee values.yaml
securityContextSecurity context for NetBox containerssee values.yaml
service.typeType of Service resource to createClusterIP
service.portPort number for the service80
service.nodePortThe port used on the node when service.type is NodePort""
service.clusterIPThe cluster IP address assigned to the service""
service.clusterIPsA list of cluster IP addresses assigned to the service[]
service.externalIPsA list of external IP addresses aliased to this service[]
service.externalTrafficPolicyPolicy for routing external traffic""
service.ipFamilyPolicyRepresents the dual-stack-ness of the service""
service.loadBalancerIPRequest a specific IP address when service.type is LoadBalancer""
service.loadBalancerSourceRangesA list of allowed IP ranges when service.type is LoadBalancer[]
ingress.enabledCreate an Ingress resource for accessing NetBoxfalse
ingress.classNameUse a named IngressClass""
ingress.annotationsExtra annotations to apply to the Ingress resource{}
ingress.hostsList of hosts and paths to map to the service (see values.yaml)[{host:"chart-example.local",paths:["/"]}]
ingress.tlsTLS settings for the Ingress resource[]
resourcesConfigure resource requests or limits for NetBox{}
readinessProbe.enabledEnable Kubernetes readinessProbe, see readiness probessee values.yaml
readinessProbe.initialDelaySecondsNumber of secondssee values.yaml
readinessProbe.timeoutSecondsNumber of secondssee values.yaml
readinessProbe.periodSecondsNumber of secondssee values.yaml
readinessProbe.successThresholdNumber of secondssee values.yaml
init.image.repositoryInit container image repositorybusybox
init.image.tagInit container image tag1.32.1
init.image.pullPolicyInit container image pull policyIfNotPresent
init.resourcesConfigure resource requests or limits for init container{}
init.securityContextSecurity context for init containersee values.yaml
autoscaling.enabledWhether to enable the HorizontalPodAutoscalerfalse
autoscaling.minReplicasMinimum number of replicas when autoscaling is enabled1
autoscaling.maxReplicasMaximum number of replicas when autoscaling is enabled100
autoscaling.targetCPUUtilizationPercentageTarget CPU utilisation percentage for autoscaling80
autoscaling.targetMemoryUtilizationPercentageTarget memory utilisation percentage for autoscalingnull
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
updateStrategyConfigure deployment update strategy{} (defaults to RollingUpdate)
affinityAffinity settings for pod assignment{}
extraEnvsAdditional environment variables to set in the NetBox container[]
extraVolumeMountsAdditional volumes to mount in the NetBox container[]
extraVolumesAdditional volumes to reference in pods[]
extraContainersAdditional sidecar containers to be added to pods[]
extraInitContainersAdditional init containers to run before starting main containers[]
workerWorker specific variables. Most global variables also apply here.see values.yaml
housekeeping.enabledWhether the HousekeepingCronJob should be activetrue
housekeeping.concurrencyPolicyConcurrencyPolicy for the Housekeeping CronJob.Forbid
housekeeping.failedJobsHistoryLimitNumber of failed jobs to keep in history5
housekeeping.restartPolicyRestart Policy for the Housekeeping CronJob.OnFailure
housekeeping.scheduleSchedule for the CronJob in Cron syntax.0 0 * * * (Midnight daily)
housekeeping.successfulJobsHistoryLimitNumber of successful jobs to keep in history5
housekeeping.suspendWhether to suspend the CronJobfalse
housekeeping.podAnnotationsAdditional annotations for housekeeping CronJob pods{}
housekeeping.podLabelsAdditional labels for housekeeping CronJob pods{}
housekeeping.podSecurityContextSecurity context for housekeeping CronJob podssee values.yaml
housekeeping.securityContextSecurity context for housekeeping CronJob containerssee values.yaml
housekeeping.resourcesConfigure resource requests or limits for housekeeping CronJob{}
housekeeping.nodeSelectorNode labels for housekeeping CronJob pod assignment{}
housekeeping.tolerationsToleration labels for housekeeping CronJob pod assignment[]
housekeeping.affinityAffinity settings for housekeeping CronJob pod assignment{}
housekeeping.extraEnvsAdditional environment variables to set in housekeeping CronJob[]
housekeeping.extraVolumeMountsAdditional volumes to mount in the housekeeping CronJob[]
housekeeping.extraVolumesAdditional volumes to reference in housekeeping CronJob pods[]
housekeeping.extraContainersAdditional sidecar containers to be added to housekeeping CronJob[]
housekeeping.extraInitContainersAdditional init containers for housekeeping CronJob pods[]

Specify each parameter using the --set key=value[,key=value] argument to helm install or provide a YAML file containing the values for the above parameters:

$ helm install --name my-release bootc/netbox --values values.yaml

Using an Existing Secret

Rather than specifying passwords and secrets as part of the Helm release values, you may pass these to NetBox using a pre-existing Secret resource. When using this, the Secret must contain the following keys:

KeyDescriptionRequired?
db_passwordThe password for the external PostgreSQL databaseIf postgresql.enabled is false and externalDatabase.existingSecretName is unset
email_passwordSMTP user passwordYes, but the value may be left blank if not required
ldap_bind_passwordPassword for LDAP bind DNIf remoteAuth.enabled is true and remoteAuth.backend is netbox.authentication.LDAPBackend
napalm_passwordNAPALM user passwordYes, but the value may be left blank if not required
redis_tasks_passwordPassword for the external Redis tasks databaseIf redis.enabled is false and tasksRedis.existingSecretName is unset
redis_cache_passwordPassword for the external Redis cache databaseIf redis.enabled is false and cachingRedis.existingSecretName is unset
secret_keyDjango secret key used for sessions and password reset tokensYes
superuser_passwordPassword for the initial super-user accountYes
superuser_api_tokenAPI token created for the initial super-user accountYes

Using extraConfig for S3 storage configuration

If you want to use S3 as your storage backend and not have the config in the values.yaml (credentials!) you can use an existing secret that is then referenced under the extraConfig key.

The secret would look like this:

apiVersion: v1kind: Secretmetadata:
labels:
app.kubernetes.io/instance: netboxname: netbox-extrastringData:
s3-config.yaml: | STORAGE_CONFIG: AWS_S3_ENDPOINT_URL: <endpoint-URL> AWS_S3_REGION_NAME: <region> AWS_STORAGE_BUCKET_NAME: <bucket-name> AWS_ACCESS_KEY_ID: <access-key> AWS_SECRET_ACCESS_KEY: <secret-key>

And the secret then has to be referenced like this:

extraConfig:
- secret: # same as pod.spec.volumes.secretsecretName: netbox-extra

Configuring SSO

You can leverage the extraConfig value in conjunction with remoteAuth to configure SSO. An example:

remoteAuth:
enabled: truebackend: social_core.backends.keycloak.KeycloakOAuth2autoCreateUser: falseextraConfig:
- values:
SOCIAL_AUTH_KEYCLOAK_KEY: 'netbox'SOCIAL_AUTH_KEYCLOAK_SECRET: 'HaveANiceDay'SOCIAL_AUTH_KEYCLOAK_PUBLIC_KEY: 'MII....'SOCIAL_AUTH_KEYCLOAK_AUTHORIZATION_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/auth'SOCIAL_AUTH_KEYCLOAK_ACCESS_TOKEN_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/token'SOCIAL_AUTH_KEYCLOAK_ID_KEY: 'email'SOCIAL_AUTH_JSONFIELD_ENABLED: True

Using LDAP Authentication

In order to enable LDAP authentication, please carry out the following steps:

  1. Set image.tag in your values to an image with LDAP support (e.g. v3.0.11-ldap)
  2. Configure the remoteAuth settings to enable the LDAP backend (see below)
  3. Make sure you set all of the remoteAuth.ldap settings shown in the values.yaml file

For example:

remoteAuth:
enabled: truebackend: netbox.authentication.LDAPBackendldap:
serverUri: 'ldap://domain.com'startTls: trueignoreCertErrors: truebindDn: ''bindPassword: ''# and ALL the other remoteAuth.ldap.* settings from values.yaml

Note: in order to use anonymous LDAP binding set bindDn and bindPassword to an empty string as in the example above.

License

The following notice applies to all files contained within this Helm Chart and the Git repository which contains it:

Copyright 2019-2020 Chris Boot

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A Helm chart for NetBox

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - gesv/netbox-chart: A Helm chart for NetBox · GitHub
Skip to content

Repository files navigation

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 cacheTimeout and releaseCheck.timeout settings 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 netbox Deployment 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 webhooksRedis configuration key in values.yaml has been renamed to tasksRedis to match the upstream name
  • The redis_password key in the Secret has been renamed to redis_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.

ParameterDescriptionDefault
replicaCountThe desired number of NetBox pods1
image.repositoryNetBox container image repositorynetboxcommunity/netbox
image.tagNetBox container image tag""
image.pullPolicyNetBox container image pull policyIfNotPresent
superuser.nameInitial super-user account to createadmin
superuser.emailEmail address for the initial super-user accountadmin@example.com
superuser.passwordPassword for the initial super-user accountadmin
superuser.apiTokenAPI token created for the initial super-user account0123456789abcdef0123456789abcdef01234567
skipStartupScriptsSkip netbox-docker startup scriptstrue
allowedHostsList of valid FQDNs for this NetBox instance["*"]
adminsList of admins to email about critical errors[]
authPasswordValidatorsConfigure validation of local user account passwords[]
allowedUrlSchemesURL schemes that are allowed within links in NetBoxsee values.yaml
banner.topBanner text to display at the top of every page""
banner.bottomBanner text to display at the bottom of every page""
banner.loginBanner text to display on the login page""
basePathBase URL path if accessing NetBox within a directory""
changelogRetentionMaximum number of days to retain logged changes (0 = forever)90
customValidatorsCustom validators for NetBox field values{}
defaultUserPreferencesDefault preferences for newly created user accounts{}
cors.originAllowAllCORS: allow all originsfalse
cors.originWhitelistCORS: list of origins authorised to make cross-site HTTP requests[]
cors.originRegexWhitelistCORS: list of regex strings matching authorised origins[]
csrf.cookieNameName of the CSRF authentication cookiecsrftoken
csrf.trustedOriginsA list of trusted origins for unsafe (e.g. POST) requests[]
debugEnable NetBox debugging (NOT for production use)false
dbWaitDebugShow details of errors that occur when applying migrationsfalse
email.serverSMTP server to use to send emailslocalhost
email.portTCP port to connect to the SMTP server on25
email.usernameOptional username for SMTP authentication""
email.passwordPassword for SMTP authentication (see also existingSecret)""
email.useSSLUse SSL when connecting to the serverfalse
email.useTLSUse TLS when connecting to the serverfalse
email.sslCertFileSMTP SSL certificate file path (e.g. in a mounted volume)""
email.sslKeyFileSMTP SSL key file path (e.g. in a mounted volume)""
email.timeoutTimeout for SMTP connections, in seconds10
email.fromSender address for emails sent by NetBox""
enforceGlobalUniqueEnforce unique IP space in the global table (not in a VRF)false
exemptViewPermissionsA list of models to exempt from the enforcement of view permissions[]
fieldChoicesConfigure custom choices for certain built-in fields{}
graphQlEnabledEnable the GraphQL APItrue
httpProxiesHTTP proxies NetBox should use when sending outbound HTTP requestsnull
internalIPsIP addresses recognized as internal to the system['127.0.0.1', '::1']
jobResultRetentionThe number of days to retain job results (scripts and reports)90
loggingCustom Django logging configuration{}
loginPersistenceEnables users to remain authenticated to NetBox indefinitelyfalse
loginRequiredPermit only logged-in users to access NetBoxfalse (unauthenticated read-only access)
loginTimeoutHow often to re-authenticate users1209600 (14 days)
maintenanceModeDisplay a "maintenance mode" banner on every pagefalse
mapsUrlThe URL to use when mapping physical addresses or GPS coordinateshttps://maps.google.com/?q=
maxPageSizeMaximum number of objects that can be returned by a single API call1000
storageBackendDjango-storages backend class namenull
storageConfigDjango-storages backend configuration{}
metricsEnabledExpose Prometheus metrics at the /metrics HTTP endpointfalse
napalm.usernameUsername used by the NAPALM library to access network devices""
napalm.passwordPassword used by the NAPALM library (see also existingSecret)""
napalm.timeoutTimeout for NAPALM to connect to a device (in seconds)30
napalm.argsA dictionary of optional arguments to pass to NAPALM{}
paginateCountThe default number of objects to display per page in the web UI50
pluginsAdditional plugins to load into NetBox[]
pluginsConfigConfiguration for the additional plugins{}
powerFeedDefaultAmperageDefault amperage value for new power feeds15
powerFeedMaxUtilisationDefault maximum utilisation percentage for new power feeds80
powerFeedDefaultVoltageDefault voltage value for new power feeds120
preferIPv4Prefer devices' IPv4 address when determining their primary addressfalse
rackElevationDefaultUnitHeightRack elevation default height in pixels22
rackElevationDefaultUnitWidthRack elevation default width in pixels220
remoteAuth.enabledEnable remote authentication supportfalse
remoteAuth.backendRemote authentication backend classnetbox.authentication.RemoteUserBackend
remoteAuth.headerThe name of the HTTP header which conveys the usernameHTTP_REMOTE_USER
remoteAuth.autoCreateUserEnables the automatic creation of new userstrue
remoteAuth.defaultGroupsA list of groups to assign to newly created users[]
remoteAuth.defaultPermissionsA list of permissions to assign newly created users{}
remoteAuth.groupSyncEnabledSync remote user groups from an HTTP header set by a reverse proxyfalse
remoteAuth.groupHeaderThe name of the HTTP header which conveys the groups to which the user belongsHTTP_REMOTE_USER_GROUP
remoteAuth.superuserGroupsThe list of groups that promote an remote User to Superuser on login[]
remoteAuth.superusersThe list of users that get promoted to Superuser on login[]
remoteAuth.staffGroupsThe list of groups that promote an remote User to Staff on login[]
remoteAuth.staffUsersThe list of users that get promoted to Staff on login[]
remoteAuth.groupSeparatorThe Seperator upon which remoteAuth.groupHeader gets split into individual groups|
remoteAuth.ldap.serverUrisee django-auth-ldap""
remoteAuth.ldap.startTlsif StarTLS should be usedsee values.yaml
remoteAuth.ldap.ignoreCertErrorsif Certificate errors should be ignoredsee values.yaml
remoteAuth.ldap.bindDnDistinguished Name to bind with""
remoteAuth.ldap.bindPasswordPassword for bind DN""
remoteAuth.ldap.userDnTemplatesee AUTH_LDAP_USER_DN_TEMPLATEsee values.yaml
remoteAuth.ldap.userSearchBaseDnsee base_dn of django_auth_ldap.config.LDAPSearchsee values.yaml
remoteAuth.ldap.userSearchAttrUser attribute name for user searchsAMAccountName
remoteAuth.ldap.groupSearchBaseDnbase DN for group searchsee values.yaml
remoteAuth.ldap.groupSearchClassdjango-auth-ldap for group searchgroup
remoteAuth.ldap.groupTypesee AUTH_LDAP_GROUP_TYPEGroupOfNamesType
remoteAuth.ldap.requireGroupDnDN of a group that is required for loginnull
remoteAuth.ldap.findGroupPermssee AUTH_LDAP_FIND_GROUP_PERMStrue
remoteAuth.ldap.mirrorGroupssee AUTH_LDAP_MIRROR_GROUPSnull
remoteAuth.ldap.cacheTimeoutsee AUTH_LDAP_MIRROR_GROUPS_EXCEPTnull
remoteAuth.ldap.isAdminDnrequired DN to be able to login in Admin-Backend, "is_staff"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.isSuperUserDnrequired DN to receive SuperUser privileges, "is_superuser"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.attrFirstNamefirst name attribute of users, "first_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPgivenName
remoteAuth.ldap.attrLastNamelast name attribute of users, "last_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPsn
remoteAuth.ldap.attrMailmail attribute of users, "email_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPmail
releaseCheck.urlRelease check URL (GitHub API URL; see values.yaml)null (disabled by default)
rqDefaultTimeoutMaximum execution time for background tasks, in seconds300 (5 minutes)
sessionCookieNameThe name to use for the session cookie"sessionid"
timeZoneThe time zone NetBox will use when dealing with dates and timesUTC
dateFormatDjango date format for long-form date strings"N j, Y"
shortDateFormatDjango date format for short-form date strings"Y-m-d"
timeFormatDjango date format for long-form time strings"g:i a"
shortTimeFormatDjango date format for short-form time strings"H:i:s"
dateTimeFormatDjango date format for long-form date and time strings"N j, Y g:i a"
shortDateTimeFormatDjango date format for short-form date and time strongs"Y-m-d H:i"
secretKeyDjango secret key used for sessions and password reset tokens"" (generated)
existingSecretUse an existing Kubernetes Secret for secret values (see below)"" (use individual chart values)
extraConfigAdditional NetBox configuration (see values.yaml)[]
postgresql.enabledDeploy PostgreSQL using bundled Bitnami PostgreSQL charttrue
postgresql.postgresqlUsernameUsername to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.postgresqlDatabaseDatabase to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.*Values under this key are passed to the bundled PostgreSQL chartn/a
externalDatabase.hostPostgreSQL host to use when postgresql.enabled is falselocalhost
externalDatabase.portPort number for external PostgreSQL5432
externalDatabase.databaseDatabase name for external PostgreSQLnetbox
externalDatabase.usernameUsername for external PostgreSQLnetbox
externalDatabase.passwordPassword for external PostgreSQL (see also existingSecret)""
externalDatabase.existingSecretNameFetch password for external PostgreSQL from a different Secret""
externalDatabase.existingSecretKeyKey to fetch the password in the above Secretpostgresql-password
externalDatabase.sslModePostgreSQL client SSL Mode settingprefer
externalDatabase.connMaxAgeThe lifetime of a database connection, as an integer of seconds300
redis.enabledDeploy Redis using bundled Bitnami Redis charttrue
redis.*Values under this key are passed to the bundled Redis chartn/a
tasksRedis.databaseRedis database number used for NetBox task queue0
tasksRedis.sslEnable SSL when connecting to Redisfalse
tasksRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
tasksRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
tasksRedis.portPort number for external Redis6379
tasksRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
tasksRedis.sentinelServiceSentinel master service name"netbox-redis"
tasksRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
tasksRedis.passwordPassword for external Redis (see also existingSecret)""
tasksRedis.existingSecretNameFetch password for external Redis from a different Secret""
tasksRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
cachingRedis.databaseRedis database number used for caching views1
cachingRedis.sslEnable SSL when connecting to Redisfalse
cachingRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
cachingRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
cachingRedis.portPort number for external Redis6379
cachingRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
cachingRedis.sentinelServiceSentinel master service name"netbox-redis"
cachingRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
cachingRedis.passwordPassword for external Redis (see also existingSecret)""
cachingRedis.existingSecretNameFetch password for external Redis from a different Secret""
cachingRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
imagePullSecretsList of Secret names containing private registry credentials[]
nameOverrideOverride the application name (netbox) used throughout the chart""
fullnameOverrideOverride the full name of resources created as part of the release""
serviceAccount.createCreate a ServiceAccount for NetBoxtrue
serviceAccount.annotationsAnnotations to add to the service account{}
serviceAccount.nameThe name of the service account to use"" (use the fullname)
persistence.enabledEnable storage persistence for uploaded media (images)true
persistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
persistence.subPathMount a sub-path of the volume into the container, not the root""
persistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
persistence.selectorSet the selector for PVs, if desired{}
persistence.accessModeAccess mode for the volumeReadWriteOnce
persistence.sizeSize of persistent volume to request1Gi
reportsPersistence.enabledEnable storage persistence for NetBox reportsfalse
reportsPersistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
reportsPersistence.subPathMount a sub-path of the volume into the container, not the root""
reportsPersistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
reportsPersistence.selectorSet the selector for PVs, if desired{}
reportsPersistence.accessModeAccess mode for the volumeReadWriteOnce
reportsPersistence.sizeSize of persistent volume to request1Gi
podAnnotationsAdditional annotations for NetBox pods{}
podLabelsAdditional labels for NetBox pods{}
podSecurityContextSecurity context for NetBox podssee values.yaml
securityContextSecurity context for NetBox containerssee values.yaml
service.typeType of Service resource to createClusterIP
service.portPort number for the service80
service.nodePortThe port used on the node when service.type is NodePort""
service.clusterIPThe cluster IP address assigned to the service""
service.clusterIPsA list of cluster IP addresses assigned to the service[]
service.externalIPsA list of external IP addresses aliased to this service[]
service.externalTrafficPolicyPolicy for routing external traffic""
service.ipFamilyPolicyRepresents the dual-stack-ness of the service""
service.loadBalancerIPRequest a specific IP address when service.type is LoadBalancer""
service.loadBalancerSourceRangesA list of allowed IP ranges when service.type is LoadBalancer[]
ingress.enabledCreate an Ingress resource for accessing NetBoxfalse
ingress.classNameUse a named IngressClass""
ingress.annotationsExtra annotations to apply to the Ingress resource{}
ingress.hostsList of hosts and paths to map to the service (see values.yaml)[{host:"chart-example.local",paths:["/"]}]
ingress.tlsTLS settings for the Ingress resource[]
resourcesConfigure resource requests or limits for NetBox{}
readinessProbe.enabledEnable Kubernetes readinessProbe, see readiness probessee values.yaml
readinessProbe.initialDelaySecondsNumber of secondssee values.yaml
readinessProbe.timeoutSecondsNumber of secondssee values.yaml
readinessProbe.periodSecondsNumber of secondssee values.yaml
readinessProbe.successThresholdNumber of secondssee values.yaml
init.image.repositoryInit container image repositorybusybox
init.image.tagInit container image tag1.32.1
init.image.pullPolicyInit container image pull policyIfNotPresent
init.resourcesConfigure resource requests or limits for init container{}
init.securityContextSecurity context for init containersee values.yaml
autoscaling.enabledWhether to enable the HorizontalPodAutoscalerfalse
autoscaling.minReplicasMinimum number of replicas when autoscaling is enabled1
autoscaling.maxReplicasMaximum number of replicas when autoscaling is enabled100
autoscaling.targetCPUUtilizationPercentageTarget CPU utilisation percentage for autoscaling80
autoscaling.targetMemoryUtilizationPercentageTarget memory utilisation percentage for autoscalingnull
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
updateStrategyConfigure deployment update strategy{} (defaults to RollingUpdate)
affinityAffinity settings for pod assignment{}
extraEnvsAdditional environment variables to set in the NetBox container[]
extraVolumeMountsAdditional volumes to mount in the NetBox container[]
extraVolumesAdditional volumes to reference in pods[]
extraContainersAdditional sidecar containers to be added to pods[]
extraInitContainersAdditional init containers to run before starting main containers[]
workerWorker specific variables. Most global variables also apply here.see values.yaml
housekeeping.enabledWhether the HousekeepingCronJob should be activetrue
housekeeping.concurrencyPolicyConcurrencyPolicy for the Housekeeping CronJob.Forbid
housekeeping.failedJobsHistoryLimitNumber of failed jobs to keep in history5
housekeeping.restartPolicyRestart Policy for the Housekeeping CronJob.OnFailure
housekeeping.scheduleSchedule for the CronJob in Cron syntax.0 0 * * * (Midnight daily)
housekeeping.successfulJobsHistoryLimitNumber of successful jobs to keep in history5
housekeeping.suspendWhether to suspend the CronJobfalse
housekeeping.podAnnotationsAdditional annotations for housekeeping CronJob pods{}
housekeeping.podLabelsAdditional labels for housekeeping CronJob pods{}
housekeeping.podSecurityContextSecurity context for housekeeping CronJob podssee values.yaml
housekeeping.securityContextSecurity context for housekeeping CronJob containerssee values.yaml
housekeeping.resourcesConfigure resource requests or limits for housekeeping CronJob{}
housekeeping.nodeSelectorNode labels for housekeeping CronJob pod assignment{}
housekeeping.tolerationsToleration labels for housekeeping CronJob pod assignment[]
housekeeping.affinityAffinity settings for housekeeping CronJob pod assignment{}
housekeeping.extraEnvsAdditional environment variables to set in housekeeping CronJob[]
housekeeping.extraVolumeMountsAdditional volumes to mount in the housekeeping CronJob[]
housekeeping.extraVolumesAdditional volumes to reference in housekeeping CronJob pods[]
housekeeping.extraContainersAdditional sidecar containers to be added to housekeeping CronJob[]
housekeeping.extraInitContainersAdditional init containers for housekeeping CronJob pods[]

Specify each parameter using the --set key=value[,key=value] argument to helm install or provide a YAML file containing the values for the above parameters:

$ helm install --name my-release bootc/netbox --values values.yaml

Using an Existing Secret

Rather than specifying passwords and secrets as part of the Helm release values, you may pass these to NetBox using a pre-existing Secret resource. When using this, the Secret must contain the following keys:

KeyDescriptionRequired?
db_passwordThe password for the external PostgreSQL databaseIf postgresql.enabled is false and externalDatabase.existingSecretName is unset
email_passwordSMTP user passwordYes, but the value may be left blank if not required
ldap_bind_passwordPassword for LDAP bind DNIf remoteAuth.enabled is true and remoteAuth.backend is netbox.authentication.LDAPBackend
napalm_passwordNAPALM user passwordYes, but the value may be left blank if not required
redis_tasks_passwordPassword for the external Redis tasks databaseIf redis.enabled is false and tasksRedis.existingSecretName is unset
redis_cache_passwordPassword for the external Redis cache databaseIf redis.enabled is false and cachingRedis.existingSecretName is unset
secret_keyDjango secret key used for sessions and password reset tokensYes
superuser_passwordPassword for the initial super-user accountYes
superuser_api_tokenAPI token created for the initial super-user accountYes

Using extraConfig for S3 storage configuration

If you want to use S3 as your storage backend and not have the config in the values.yaml (credentials!) you can use an existing secret that is then referenced under the extraConfig key.

The secret would look like this:

apiVersion: v1kind: Secretmetadata:
labels:
app.kubernetes.io/instance: netboxname: netbox-extrastringData:
s3-config.yaml: | STORAGE_CONFIG: AWS_S3_ENDPOINT_URL: <endpoint-URL> AWS_S3_REGION_NAME: <region> AWS_STORAGE_BUCKET_NAME: <bucket-name> AWS_ACCESS_KEY_ID: <access-key> AWS_SECRET_ACCESS_KEY: <secret-key>

And the secret then has to be referenced like this:

extraConfig:
- secret: # same as pod.spec.volumes.secretsecretName: netbox-extra

Configuring SSO

You can leverage the extraConfig value in conjunction with remoteAuth to configure SSO. An example:

remoteAuth:
enabled: truebackend: social_core.backends.keycloak.KeycloakOAuth2autoCreateUser: falseextraConfig:
- values:
SOCIAL_AUTH_KEYCLOAK_KEY: 'netbox'SOCIAL_AUTH_KEYCLOAK_SECRET: 'HaveANiceDay'SOCIAL_AUTH_KEYCLOAK_PUBLIC_KEY: 'MII....'SOCIAL_AUTH_KEYCLOAK_AUTHORIZATION_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/auth'SOCIAL_AUTH_KEYCLOAK_ACCESS_TOKEN_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/token'SOCIAL_AUTH_KEYCLOAK_ID_KEY: 'email'SOCIAL_AUTH_JSONFIELD_ENABLED: True

Using LDAP Authentication

In order to enable LDAP authentication, please carry out the following steps:

  1. Set image.tag in your values to an image with LDAP support (e.g. v3.0.11-ldap)
  2. Configure the remoteAuth settings to enable the LDAP backend (see below)
  3. Make sure you set all of the remoteAuth.ldap settings shown in the values.yaml file

For example:

remoteAuth:
enabled: truebackend: netbox.authentication.LDAPBackendldap:
serverUri: 'ldap://domain.com'startTls: trueignoreCertErrors: truebindDn: ''bindPassword: ''# and ALL the other remoteAuth.ldap.* settings from values.yaml

Note: in order to use anonymous LDAP binding set bindDn and bindPassword to an empty string as in the example above.

License

The following notice applies to all files contained within this Helm Chart and the Git repository which contains it:

Copyright 2019-2020 Chris Boot

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A Helm chart for NetBox

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - gesv/netbox-chart: A Helm chart for NetBox · GitHub
Skip to content

Repository files navigation

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 cacheTimeout and releaseCheck.timeout settings 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 netbox Deployment 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 webhooksRedis configuration key in values.yaml has been renamed to tasksRedis to match the upstream name
  • The redis_password key in the Secret has been renamed to redis_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.

ParameterDescriptionDefault
replicaCountThe desired number of NetBox pods1
image.repositoryNetBox container image repositorynetboxcommunity/netbox
image.tagNetBox container image tag""
image.pullPolicyNetBox container image pull policyIfNotPresent
superuser.nameInitial super-user account to createadmin
superuser.emailEmail address for the initial super-user accountadmin@example.com
superuser.passwordPassword for the initial super-user accountadmin
superuser.apiTokenAPI token created for the initial super-user account0123456789abcdef0123456789abcdef01234567
skipStartupScriptsSkip netbox-docker startup scriptstrue
allowedHostsList of valid FQDNs for this NetBox instance["*"]
adminsList of admins to email about critical errors[]
authPasswordValidatorsConfigure validation of local user account passwords[]
allowedUrlSchemesURL schemes that are allowed within links in NetBoxsee values.yaml
banner.topBanner text to display at the top of every page""
banner.bottomBanner text to display at the bottom of every page""
banner.loginBanner text to display on the login page""
basePathBase URL path if accessing NetBox within a directory""
changelogRetentionMaximum number of days to retain logged changes (0 = forever)90
customValidatorsCustom validators for NetBox field values{}
defaultUserPreferencesDefault preferences for newly created user accounts{}
cors.originAllowAllCORS: allow all originsfalse
cors.originWhitelistCORS: list of origins authorised to make cross-site HTTP requests[]
cors.originRegexWhitelistCORS: list of regex strings matching authorised origins[]
csrf.cookieNameName of the CSRF authentication cookiecsrftoken
csrf.trustedOriginsA list of trusted origins for unsafe (e.g. POST) requests[]
debugEnable NetBox debugging (NOT for production use)false
dbWaitDebugShow details of errors that occur when applying migrationsfalse
email.serverSMTP server to use to send emailslocalhost
email.portTCP port to connect to the SMTP server on25
email.usernameOptional username for SMTP authentication""
email.passwordPassword for SMTP authentication (see also existingSecret)""
email.useSSLUse SSL when connecting to the serverfalse
email.useTLSUse TLS when connecting to the serverfalse
email.sslCertFileSMTP SSL certificate file path (e.g. in a mounted volume)""
email.sslKeyFileSMTP SSL key file path (e.g. in a mounted volume)""
email.timeoutTimeout for SMTP connections, in seconds10
email.fromSender address for emails sent by NetBox""
enforceGlobalUniqueEnforce unique IP space in the global table (not in a VRF)false
exemptViewPermissionsA list of models to exempt from the enforcement of view permissions[]
fieldChoicesConfigure custom choices for certain built-in fields{}
graphQlEnabledEnable the GraphQL APItrue
httpProxiesHTTP proxies NetBox should use when sending outbound HTTP requestsnull
internalIPsIP addresses recognized as internal to the system['127.0.0.1', '::1']
jobResultRetentionThe number of days to retain job results (scripts and reports)90
loggingCustom Django logging configuration{}
loginPersistenceEnables users to remain authenticated to NetBox indefinitelyfalse
loginRequiredPermit only logged-in users to access NetBoxfalse (unauthenticated read-only access)
loginTimeoutHow often to re-authenticate users1209600 (14 days)
maintenanceModeDisplay a "maintenance mode" banner on every pagefalse
mapsUrlThe URL to use when mapping physical addresses or GPS coordinateshttps://maps.google.com/?q=
maxPageSizeMaximum number of objects that can be returned by a single API call1000
storageBackendDjango-storages backend class namenull
storageConfigDjango-storages backend configuration{}
metricsEnabledExpose Prometheus metrics at the /metrics HTTP endpointfalse
napalm.usernameUsername used by the NAPALM library to access network devices""
napalm.passwordPassword used by the NAPALM library (see also existingSecret)""
napalm.timeoutTimeout for NAPALM to connect to a device (in seconds)30
napalm.argsA dictionary of optional arguments to pass to NAPALM{}
paginateCountThe default number of objects to display per page in the web UI50
pluginsAdditional plugins to load into NetBox[]
pluginsConfigConfiguration for the additional plugins{}
powerFeedDefaultAmperageDefault amperage value for new power feeds15
powerFeedMaxUtilisationDefault maximum utilisation percentage for new power feeds80
powerFeedDefaultVoltageDefault voltage value for new power feeds120
preferIPv4Prefer devices' IPv4 address when determining their primary addressfalse
rackElevationDefaultUnitHeightRack elevation default height in pixels22
rackElevationDefaultUnitWidthRack elevation default width in pixels220
remoteAuth.enabledEnable remote authentication supportfalse
remoteAuth.backendRemote authentication backend classnetbox.authentication.RemoteUserBackend
remoteAuth.headerThe name of the HTTP header which conveys the usernameHTTP_REMOTE_USER
remoteAuth.autoCreateUserEnables the automatic creation of new userstrue
remoteAuth.defaultGroupsA list of groups to assign to newly created users[]
remoteAuth.defaultPermissionsA list of permissions to assign newly created users{}
remoteAuth.groupSyncEnabledSync remote user groups from an HTTP header set by a reverse proxyfalse
remoteAuth.groupHeaderThe name of the HTTP header which conveys the groups to which the user belongsHTTP_REMOTE_USER_GROUP
remoteAuth.superuserGroupsThe list of groups that promote an remote User to Superuser on login[]
remoteAuth.superusersThe list of users that get promoted to Superuser on login[]
remoteAuth.staffGroupsThe list of groups that promote an remote User to Staff on login[]
remoteAuth.staffUsersThe list of users that get promoted to Staff on login[]
remoteAuth.groupSeparatorThe Seperator upon which remoteAuth.groupHeader gets split into individual groups|
remoteAuth.ldap.serverUrisee django-auth-ldap""
remoteAuth.ldap.startTlsif StarTLS should be usedsee values.yaml
remoteAuth.ldap.ignoreCertErrorsif Certificate errors should be ignoredsee values.yaml
remoteAuth.ldap.bindDnDistinguished Name to bind with""
remoteAuth.ldap.bindPasswordPassword for bind DN""
remoteAuth.ldap.userDnTemplatesee AUTH_LDAP_USER_DN_TEMPLATEsee values.yaml
remoteAuth.ldap.userSearchBaseDnsee base_dn of django_auth_ldap.config.LDAPSearchsee values.yaml
remoteAuth.ldap.userSearchAttrUser attribute name for user searchsAMAccountName
remoteAuth.ldap.groupSearchBaseDnbase DN for group searchsee values.yaml
remoteAuth.ldap.groupSearchClassdjango-auth-ldap for group searchgroup
remoteAuth.ldap.groupTypesee AUTH_LDAP_GROUP_TYPEGroupOfNamesType
remoteAuth.ldap.requireGroupDnDN of a group that is required for loginnull
remoteAuth.ldap.findGroupPermssee AUTH_LDAP_FIND_GROUP_PERMStrue
remoteAuth.ldap.mirrorGroupssee AUTH_LDAP_MIRROR_GROUPSnull
remoteAuth.ldap.cacheTimeoutsee AUTH_LDAP_MIRROR_GROUPS_EXCEPTnull
remoteAuth.ldap.isAdminDnrequired DN to be able to login in Admin-Backend, "is_staff"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.isSuperUserDnrequired DN to receive SuperUser privileges, "is_superuser"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.attrFirstNamefirst name attribute of users, "first_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPgivenName
remoteAuth.ldap.attrLastNamelast name attribute of users, "last_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPsn
remoteAuth.ldap.attrMailmail attribute of users, "email_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPmail
releaseCheck.urlRelease check URL (GitHub API URL; see values.yaml)null (disabled by default)
rqDefaultTimeoutMaximum execution time for background tasks, in seconds300 (5 minutes)
sessionCookieNameThe name to use for the session cookie"sessionid"
timeZoneThe time zone NetBox will use when dealing with dates and timesUTC
dateFormatDjango date format for long-form date strings"N j, Y"
shortDateFormatDjango date format for short-form date strings"Y-m-d"
timeFormatDjango date format for long-form time strings"g:i a"
shortTimeFormatDjango date format for short-form time strings"H:i:s"
dateTimeFormatDjango date format for long-form date and time strings"N j, Y g:i a"
shortDateTimeFormatDjango date format for short-form date and time strongs"Y-m-d H:i"
secretKeyDjango secret key used for sessions and password reset tokens"" (generated)
existingSecretUse an existing Kubernetes Secret for secret values (see below)"" (use individual chart values)
extraConfigAdditional NetBox configuration (see values.yaml)[]
postgresql.enabledDeploy PostgreSQL using bundled Bitnami PostgreSQL charttrue
postgresql.postgresqlUsernameUsername to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.postgresqlDatabaseDatabase to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.*Values under this key are passed to the bundled PostgreSQL chartn/a
externalDatabase.hostPostgreSQL host to use when postgresql.enabled is falselocalhost
externalDatabase.portPort number for external PostgreSQL5432
externalDatabase.databaseDatabase name for external PostgreSQLnetbox
externalDatabase.usernameUsername for external PostgreSQLnetbox
externalDatabase.passwordPassword for external PostgreSQL (see also existingSecret)""
externalDatabase.existingSecretNameFetch password for external PostgreSQL from a different Secret""
externalDatabase.existingSecretKeyKey to fetch the password in the above Secretpostgresql-password
externalDatabase.sslModePostgreSQL client SSL Mode settingprefer
externalDatabase.connMaxAgeThe lifetime of a database connection, as an integer of seconds300
redis.enabledDeploy Redis using bundled Bitnami Redis charttrue
redis.*Values under this key are passed to the bundled Redis chartn/a
tasksRedis.databaseRedis database number used for NetBox task queue0
tasksRedis.sslEnable SSL when connecting to Redisfalse
tasksRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
tasksRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
tasksRedis.portPort number for external Redis6379
tasksRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
tasksRedis.sentinelServiceSentinel master service name"netbox-redis"
tasksRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
tasksRedis.passwordPassword for external Redis (see also existingSecret)""
tasksRedis.existingSecretNameFetch password for external Redis from a different Secret""
tasksRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
cachingRedis.databaseRedis database number used for caching views1
cachingRedis.sslEnable SSL when connecting to Redisfalse
cachingRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
cachingRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
cachingRedis.portPort number for external Redis6379
cachingRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
cachingRedis.sentinelServiceSentinel master service name"netbox-redis"
cachingRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
cachingRedis.passwordPassword for external Redis (see also existingSecret)""
cachingRedis.existingSecretNameFetch password for external Redis from a different Secret""
cachingRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
imagePullSecretsList of Secret names containing private registry credentials[]
nameOverrideOverride the application name (netbox) used throughout the chart""
fullnameOverrideOverride the full name of resources created as part of the release""
serviceAccount.createCreate a ServiceAccount for NetBoxtrue
serviceAccount.annotationsAnnotations to add to the service account{}
serviceAccount.nameThe name of the service account to use"" (use the fullname)
persistence.enabledEnable storage persistence for uploaded media (images)true
persistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
persistence.subPathMount a sub-path of the volume into the container, not the root""
persistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
persistence.selectorSet the selector for PVs, if desired{}
persistence.accessModeAccess mode for the volumeReadWriteOnce
persistence.sizeSize of persistent volume to request1Gi
reportsPersistence.enabledEnable storage persistence for NetBox reportsfalse
reportsPersistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
reportsPersistence.subPathMount a sub-path of the volume into the container, not the root""
reportsPersistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
reportsPersistence.selectorSet the selector for PVs, if desired{}
reportsPersistence.accessModeAccess mode for the volumeReadWriteOnce
reportsPersistence.sizeSize of persistent volume to request1Gi
podAnnotationsAdditional annotations for NetBox pods{}
podLabelsAdditional labels for NetBox pods{}
podSecurityContextSecurity context for NetBox podssee values.yaml
securityContextSecurity context for NetBox containerssee values.yaml
service.typeType of Service resource to createClusterIP
service.portPort number for the service80
service.nodePortThe port used on the node when service.type is NodePort""
service.clusterIPThe cluster IP address assigned to the service""
service.clusterIPsA list of cluster IP addresses assigned to the service[]
service.externalIPsA list of external IP addresses aliased to this service[]
service.externalTrafficPolicyPolicy for routing external traffic""
service.ipFamilyPolicyRepresents the dual-stack-ness of the service""
service.loadBalancerIPRequest a specific IP address when service.type is LoadBalancer""
service.loadBalancerSourceRangesA list of allowed IP ranges when service.type is LoadBalancer[]
ingress.enabledCreate an Ingress resource for accessing NetBoxfalse
ingress.classNameUse a named IngressClass""
ingress.annotationsExtra annotations to apply to the Ingress resource{}
ingress.hostsList of hosts and paths to map to the service (see values.yaml)[{host:"chart-example.local",paths:["/"]}]
ingress.tlsTLS settings for the Ingress resource[]
resourcesConfigure resource requests or limits for NetBox{}
readinessProbe.enabledEnable Kubernetes readinessProbe, see readiness probessee values.yaml
readinessProbe.initialDelaySecondsNumber of secondssee values.yaml
readinessProbe.timeoutSecondsNumber of secondssee values.yaml
readinessProbe.periodSecondsNumber of secondssee values.yaml
readinessProbe.successThresholdNumber of secondssee values.yaml
init.image.repositoryInit container image repositorybusybox
init.image.tagInit container image tag1.32.1
init.image.pullPolicyInit container image pull policyIfNotPresent
init.resourcesConfigure resource requests or limits for init container{}
init.securityContextSecurity context for init containersee values.yaml
autoscaling.enabledWhether to enable the HorizontalPodAutoscalerfalse
autoscaling.minReplicasMinimum number of replicas when autoscaling is enabled1
autoscaling.maxReplicasMaximum number of replicas when autoscaling is enabled100
autoscaling.targetCPUUtilizationPercentageTarget CPU utilisation percentage for autoscaling80
autoscaling.targetMemoryUtilizationPercentageTarget memory utilisation percentage for autoscalingnull
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
updateStrategyConfigure deployment update strategy{} (defaults to RollingUpdate)
affinityAffinity settings for pod assignment{}
extraEnvsAdditional environment variables to set in the NetBox container[]
extraVolumeMountsAdditional volumes to mount in the NetBox container[]
extraVolumesAdditional volumes to reference in pods[]
extraContainersAdditional sidecar containers to be added to pods[]
extraInitContainersAdditional init containers to run before starting main containers[]
workerWorker specific variables. Most global variables also apply here.see values.yaml
housekeeping.enabledWhether the HousekeepingCronJob should be activetrue
housekeeping.concurrencyPolicyConcurrencyPolicy for the Housekeeping CronJob.Forbid
housekeeping.failedJobsHistoryLimitNumber of failed jobs to keep in history5
housekeeping.restartPolicyRestart Policy for the Housekeeping CronJob.OnFailure
housekeeping.scheduleSchedule for the CronJob in Cron syntax.0 0 * * * (Midnight daily)
housekeeping.successfulJobsHistoryLimitNumber of successful jobs to keep in history5
housekeeping.suspendWhether to suspend the CronJobfalse
housekeeping.podAnnotationsAdditional annotations for housekeeping CronJob pods{}
housekeeping.podLabelsAdditional labels for housekeeping CronJob pods{}
housekeeping.podSecurityContextSecurity context for housekeeping CronJob podssee values.yaml
housekeeping.securityContextSecurity context for housekeeping CronJob containerssee values.yaml
housekeeping.resourcesConfigure resource requests or limits for housekeeping CronJob{}
housekeeping.nodeSelectorNode labels for housekeeping CronJob pod assignment{}
housekeeping.tolerationsToleration labels for housekeeping CronJob pod assignment[]
housekeeping.affinityAffinity settings for housekeeping CronJob pod assignment{}
housekeeping.extraEnvsAdditional environment variables to set in housekeeping CronJob[]
housekeeping.extraVolumeMountsAdditional volumes to mount in the housekeeping CronJob[]
housekeeping.extraVolumesAdditional volumes to reference in housekeeping CronJob pods[]
housekeeping.extraContainersAdditional sidecar containers to be added to housekeeping CronJob[]
housekeeping.extraInitContainersAdditional init containers for housekeeping CronJob pods[]

Specify each parameter using the --set key=value[,key=value] argument to helm install or provide a YAML file containing the values for the above parameters:

$ helm install --name my-release bootc/netbox --values values.yaml

Using an Existing Secret

Rather than specifying passwords and secrets as part of the Helm release values, you may pass these to NetBox using a pre-existing Secret resource. When using this, the Secret must contain the following keys:

KeyDescriptionRequired?
db_passwordThe password for the external PostgreSQL databaseIf postgresql.enabled is false and externalDatabase.existingSecretName is unset
email_passwordSMTP user passwordYes, but the value may be left blank if not required
ldap_bind_passwordPassword for LDAP bind DNIf remoteAuth.enabled is true and remoteAuth.backend is netbox.authentication.LDAPBackend
napalm_passwordNAPALM user passwordYes, but the value may be left blank if not required
redis_tasks_passwordPassword for the external Redis tasks databaseIf redis.enabled is false and tasksRedis.existingSecretName is unset
redis_cache_passwordPassword for the external Redis cache databaseIf redis.enabled is false and cachingRedis.existingSecretName is unset
secret_keyDjango secret key used for sessions and password reset tokensYes
superuser_passwordPassword for the initial super-user accountYes
superuser_api_tokenAPI token created for the initial super-user accountYes

Using extraConfig for S3 storage configuration

If you want to use S3 as your storage backend and not have the config in the values.yaml (credentials!) you can use an existing secret that is then referenced under the extraConfig key.

The secret would look like this:

apiVersion: v1kind: Secretmetadata:
labels:
app.kubernetes.io/instance: netboxname: netbox-extrastringData:
s3-config.yaml: | STORAGE_CONFIG: AWS_S3_ENDPOINT_URL: <endpoint-URL> AWS_S3_REGION_NAME: <region> AWS_STORAGE_BUCKET_NAME: <bucket-name> AWS_ACCESS_KEY_ID: <access-key> AWS_SECRET_ACCESS_KEY: <secret-key>

And the secret then has to be referenced like this:

extraConfig:
- secret: # same as pod.spec.volumes.secretsecretName: netbox-extra

Configuring SSO

You can leverage the extraConfig value in conjunction with remoteAuth to configure SSO. An example:

remoteAuth:
enabled: truebackend: social_core.backends.keycloak.KeycloakOAuth2autoCreateUser: falseextraConfig:
- values:
SOCIAL_AUTH_KEYCLOAK_KEY: 'netbox'SOCIAL_AUTH_KEYCLOAK_SECRET: 'HaveANiceDay'SOCIAL_AUTH_KEYCLOAK_PUBLIC_KEY: 'MII....'SOCIAL_AUTH_KEYCLOAK_AUTHORIZATION_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/auth'SOCIAL_AUTH_KEYCLOAK_ACCESS_TOKEN_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/token'SOCIAL_AUTH_KEYCLOAK_ID_KEY: 'email'SOCIAL_AUTH_JSONFIELD_ENABLED: True

Using LDAP Authentication

In order to enable LDAP authentication, please carry out the following steps:

  1. Set image.tag in your values to an image with LDAP support (e.g. v3.0.11-ldap)
  2. Configure the remoteAuth settings to enable the LDAP backend (see below)
  3. Make sure you set all of the remoteAuth.ldap settings shown in the values.yaml file

For example:

remoteAuth:
enabled: truebackend: netbox.authentication.LDAPBackendldap:
serverUri: 'ldap://domain.com'startTls: trueignoreCertErrors: truebindDn: ''bindPassword: ''# and ALL the other remoteAuth.ldap.* settings from values.yaml

Note: in order to use anonymous LDAP binding set bindDn and bindPassword to an empty string as in the example above.

License

The following notice applies to all files contained within this Helm Chart and the Git repository which contains it:

Copyright 2019-2020 Chris Boot

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A Helm chart for NetBox

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - gesv/netbox-chart: A Helm chart for NetBox · GitHub
Skip to content

Repository files navigation

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 cacheTimeout and releaseCheck.timeout settings 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 netbox Deployment 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 webhooksRedis configuration key in values.yaml has been renamed to tasksRedis to match the upstream name
  • The redis_password key in the Secret has been renamed to redis_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.

ParameterDescriptionDefault
replicaCountThe desired number of NetBox pods1
image.repositoryNetBox container image repositorynetboxcommunity/netbox
image.tagNetBox container image tag""
image.pullPolicyNetBox container image pull policyIfNotPresent
superuser.nameInitial super-user account to createadmin
superuser.emailEmail address for the initial super-user accountadmin@example.com
superuser.passwordPassword for the initial super-user accountadmin
superuser.apiTokenAPI token created for the initial super-user account0123456789abcdef0123456789abcdef01234567
skipStartupScriptsSkip netbox-docker startup scriptstrue
allowedHostsList of valid FQDNs for this NetBox instance["*"]
adminsList of admins to email about critical errors[]
authPasswordValidatorsConfigure validation of local user account passwords[]
allowedUrlSchemesURL schemes that are allowed within links in NetBoxsee values.yaml
banner.topBanner text to display at the top of every page""
banner.bottomBanner text to display at the bottom of every page""
banner.loginBanner text to display on the login page""
basePathBase URL path if accessing NetBox within a directory""
changelogRetentionMaximum number of days to retain logged changes (0 = forever)90
customValidatorsCustom validators for NetBox field values{}
defaultUserPreferencesDefault preferences for newly created user accounts{}
cors.originAllowAllCORS: allow all originsfalse
cors.originWhitelistCORS: list of origins authorised to make cross-site HTTP requests[]
cors.originRegexWhitelistCORS: list of regex strings matching authorised origins[]
csrf.cookieNameName of the CSRF authentication cookiecsrftoken
csrf.trustedOriginsA list of trusted origins for unsafe (e.g. POST) requests[]
debugEnable NetBox debugging (NOT for production use)false
dbWaitDebugShow details of errors that occur when applying migrationsfalse
email.serverSMTP server to use to send emailslocalhost
email.portTCP port to connect to the SMTP server on25
email.usernameOptional username for SMTP authentication""
email.passwordPassword for SMTP authentication (see also existingSecret)""
email.useSSLUse SSL when connecting to the serverfalse
email.useTLSUse TLS when connecting to the serverfalse
email.sslCertFileSMTP SSL certificate file path (e.g. in a mounted volume)""
email.sslKeyFileSMTP SSL key file path (e.g. in a mounted volume)""
email.timeoutTimeout for SMTP connections, in seconds10
email.fromSender address for emails sent by NetBox""
enforceGlobalUniqueEnforce unique IP space in the global table (not in a VRF)false
exemptViewPermissionsA list of models to exempt from the enforcement of view permissions[]
fieldChoicesConfigure custom choices for certain built-in fields{}
graphQlEnabledEnable the GraphQL APItrue
httpProxiesHTTP proxies NetBox should use when sending outbound HTTP requestsnull
internalIPsIP addresses recognized as internal to the system['127.0.0.1', '::1']
jobResultRetentionThe number of days to retain job results (scripts and reports)90
loggingCustom Django logging configuration{}
loginPersistenceEnables users to remain authenticated to NetBox indefinitelyfalse
loginRequiredPermit only logged-in users to access NetBoxfalse (unauthenticated read-only access)
loginTimeoutHow often to re-authenticate users1209600 (14 days)
maintenanceModeDisplay a "maintenance mode" banner on every pagefalse
mapsUrlThe URL to use when mapping physical addresses or GPS coordinateshttps://maps.google.com/?q=
maxPageSizeMaximum number of objects that can be returned by a single API call1000
storageBackendDjango-storages backend class namenull
storageConfigDjango-storages backend configuration{}
metricsEnabledExpose Prometheus metrics at the /metrics HTTP endpointfalse
napalm.usernameUsername used by the NAPALM library to access network devices""
napalm.passwordPassword used by the NAPALM library (see also existingSecret)""
napalm.timeoutTimeout for NAPALM to connect to a device (in seconds)30
napalm.argsA dictionary of optional arguments to pass to NAPALM{}
paginateCountThe default number of objects to display per page in the web UI50
pluginsAdditional plugins to load into NetBox[]
pluginsConfigConfiguration for the additional plugins{}
powerFeedDefaultAmperageDefault amperage value for new power feeds15
powerFeedMaxUtilisationDefault maximum utilisation percentage for new power feeds80
powerFeedDefaultVoltageDefault voltage value for new power feeds120
preferIPv4Prefer devices' IPv4 address when determining their primary addressfalse
rackElevationDefaultUnitHeightRack elevation default height in pixels22
rackElevationDefaultUnitWidthRack elevation default width in pixels220
remoteAuth.enabledEnable remote authentication supportfalse
remoteAuth.backendRemote authentication backend classnetbox.authentication.RemoteUserBackend
remoteAuth.headerThe name of the HTTP header which conveys the usernameHTTP_REMOTE_USER
remoteAuth.autoCreateUserEnables the automatic creation of new userstrue
remoteAuth.defaultGroupsA list of groups to assign to newly created users[]
remoteAuth.defaultPermissionsA list of permissions to assign newly created users{}
remoteAuth.groupSyncEnabledSync remote user groups from an HTTP header set by a reverse proxyfalse
remoteAuth.groupHeaderThe name of the HTTP header which conveys the groups to which the user belongsHTTP_REMOTE_USER_GROUP
remoteAuth.superuserGroupsThe list of groups that promote an remote User to Superuser on login[]
remoteAuth.superusersThe list of users that get promoted to Superuser on login[]
remoteAuth.staffGroupsThe list of groups that promote an remote User to Staff on login[]
remoteAuth.staffUsersThe list of users that get promoted to Staff on login[]
remoteAuth.groupSeparatorThe Seperator upon which remoteAuth.groupHeader gets split into individual groups|
remoteAuth.ldap.serverUrisee django-auth-ldap""
remoteAuth.ldap.startTlsif StarTLS should be usedsee values.yaml
remoteAuth.ldap.ignoreCertErrorsif Certificate errors should be ignoredsee values.yaml
remoteAuth.ldap.bindDnDistinguished Name to bind with""
remoteAuth.ldap.bindPasswordPassword for bind DN""
remoteAuth.ldap.userDnTemplatesee AUTH_LDAP_USER_DN_TEMPLATEsee values.yaml
remoteAuth.ldap.userSearchBaseDnsee base_dn of django_auth_ldap.config.LDAPSearchsee values.yaml
remoteAuth.ldap.userSearchAttrUser attribute name for user searchsAMAccountName
remoteAuth.ldap.groupSearchBaseDnbase DN for group searchsee values.yaml
remoteAuth.ldap.groupSearchClassdjango-auth-ldap for group searchgroup
remoteAuth.ldap.groupTypesee AUTH_LDAP_GROUP_TYPEGroupOfNamesType
remoteAuth.ldap.requireGroupDnDN of a group that is required for loginnull
remoteAuth.ldap.findGroupPermssee AUTH_LDAP_FIND_GROUP_PERMStrue
remoteAuth.ldap.mirrorGroupssee AUTH_LDAP_MIRROR_GROUPSnull
remoteAuth.ldap.cacheTimeoutsee AUTH_LDAP_MIRROR_GROUPS_EXCEPTnull
remoteAuth.ldap.isAdminDnrequired DN to be able to login in Admin-Backend, "is_staff"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.isSuperUserDnrequired DN to receive SuperUser privileges, "is_superuser"-Attribute of AUTH_LDAP_USER_FLAGS_BY_GROUPsee values.yaml
remoteAuth.ldap.attrFirstNamefirst name attribute of users, "first_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPgivenName
remoteAuth.ldap.attrLastNamelast name attribute of users, "last_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPsn
remoteAuth.ldap.attrMailmail attribute of users, "email_name"-Attribute of AUTH_LDAP_USER_ATTR_MAPmail
releaseCheck.urlRelease check URL (GitHub API URL; see values.yaml)null (disabled by default)
rqDefaultTimeoutMaximum execution time for background tasks, in seconds300 (5 minutes)
sessionCookieNameThe name to use for the session cookie"sessionid"
timeZoneThe time zone NetBox will use when dealing with dates and timesUTC
dateFormatDjango date format for long-form date strings"N j, Y"
shortDateFormatDjango date format for short-form date strings"Y-m-d"
timeFormatDjango date format for long-form time strings"g:i a"
shortTimeFormatDjango date format for short-form time strings"H:i:s"
dateTimeFormatDjango date format for long-form date and time strings"N j, Y g:i a"
shortDateTimeFormatDjango date format for short-form date and time strongs"Y-m-d H:i"
secretKeyDjango secret key used for sessions and password reset tokens"" (generated)
existingSecretUse an existing Kubernetes Secret for secret values (see below)"" (use individual chart values)
extraConfigAdditional NetBox configuration (see values.yaml)[]
postgresql.enabledDeploy PostgreSQL using bundled Bitnami PostgreSQL charttrue
postgresql.postgresqlUsernameUsername to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.postgresqlDatabaseDatabase to create for NetBox in bundled PostgreSQL instancenetbox
postgresql.*Values under this key are passed to the bundled PostgreSQL chartn/a
externalDatabase.hostPostgreSQL host to use when postgresql.enabled is falselocalhost
externalDatabase.portPort number for external PostgreSQL5432
externalDatabase.databaseDatabase name for external PostgreSQLnetbox
externalDatabase.usernameUsername for external PostgreSQLnetbox
externalDatabase.passwordPassword for external PostgreSQL (see also existingSecret)""
externalDatabase.existingSecretNameFetch password for external PostgreSQL from a different Secret""
externalDatabase.existingSecretKeyKey to fetch the password in the above Secretpostgresql-password
externalDatabase.sslModePostgreSQL client SSL Mode settingprefer
externalDatabase.connMaxAgeThe lifetime of a database connection, as an integer of seconds300
redis.enabledDeploy Redis using bundled Bitnami Redis charttrue
redis.*Values under this key are passed to the bundled Redis chartn/a
tasksRedis.databaseRedis database number used for NetBox task queue0
tasksRedis.sslEnable SSL when connecting to Redisfalse
tasksRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
tasksRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
tasksRedis.portPort number for external Redis6379
tasksRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
tasksRedis.sentinelServiceSentinel master service name"netbox-redis"
tasksRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
tasksRedis.passwordPassword for external Redis (see also existingSecret)""
tasksRedis.existingSecretNameFetch password for external Redis from a different Secret""
tasksRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
cachingRedis.databaseRedis database number used for caching views1
cachingRedis.sslEnable SSL when connecting to Redisfalse
cachingRedis.insecureSkipTlsVerifySkip TLS certificate verification when connecting to Redisfalse
cachingRedis.hostRedis host to use when redis.enabled is false"netbox-redis"
cachingRedis.portPort number for external Redis6379
cachingRedis.sentinelsList of sentinels in host:port form (host and port not used)[]
cachingRedis.sentinelServiceSentinel master service name"netbox-redis"
cachingRedis.sentinelTimeoutSentinel connection timeout, in seconds300 (5 minutes)
cachingRedis.passwordPassword for external Redis (see also existingSecret)""
cachingRedis.existingSecretNameFetch password for external Redis from a different Secret""
cachingRedis.existingSecretKeyKey to fetch the password in the above Secretredis-password
imagePullSecretsList of Secret names containing private registry credentials[]
nameOverrideOverride the application name (netbox) used throughout the chart""
fullnameOverrideOverride the full name of resources created as part of the release""
serviceAccount.createCreate a ServiceAccount for NetBoxtrue
serviceAccount.annotationsAnnotations to add to the service account{}
serviceAccount.nameThe name of the service account to use"" (use the fullname)
persistence.enabledEnable storage persistence for uploaded media (images)true
persistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
persistence.subPathMount a sub-path of the volume into the container, not the root""
persistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
persistence.selectorSet the selector for PVs, if desired{}
persistence.accessModeAccess mode for the volumeReadWriteOnce
persistence.sizeSize of persistent volume to request1Gi
reportsPersistence.enabledEnable storage persistence for NetBox reportsfalse
reportsPersistence.existingClaimUse an existing PersistentVolumeClaim instead of creating one""
reportsPersistence.subPathMount a sub-path of the volume into the container, not the root""
reportsPersistence.storageClassSet the storage class of the PVC (use - to disable provisioning)""
reportsPersistence.selectorSet the selector for PVs, if desired{}
reportsPersistence.accessModeAccess mode for the volumeReadWriteOnce
reportsPersistence.sizeSize of persistent volume to request1Gi
podAnnotationsAdditional annotations for NetBox pods{}
podLabelsAdditional labels for NetBox pods{}
podSecurityContextSecurity context for NetBox podssee values.yaml
securityContextSecurity context for NetBox containerssee values.yaml
service.typeType of Service resource to createClusterIP
service.portPort number for the service80
service.nodePortThe port used on the node when service.type is NodePort""
service.clusterIPThe cluster IP address assigned to the service""
service.clusterIPsA list of cluster IP addresses assigned to the service[]
service.externalIPsA list of external IP addresses aliased to this service[]
service.externalTrafficPolicyPolicy for routing external traffic""
service.ipFamilyPolicyRepresents the dual-stack-ness of the service""
service.loadBalancerIPRequest a specific IP address when service.type is LoadBalancer""
service.loadBalancerSourceRangesA list of allowed IP ranges when service.type is LoadBalancer[]
ingress.enabledCreate an Ingress resource for accessing NetBoxfalse
ingress.classNameUse a named IngressClass""
ingress.annotationsExtra annotations to apply to the Ingress resource{}
ingress.hostsList of hosts and paths to map to the service (see values.yaml)[{host:"chart-example.local",paths:["/"]}]
ingress.tlsTLS settings for the Ingress resource[]
resourcesConfigure resource requests or limits for NetBox{}
readinessProbe.enabledEnable Kubernetes readinessProbe, see readiness probessee values.yaml
readinessProbe.initialDelaySecondsNumber of secondssee values.yaml
readinessProbe.timeoutSecondsNumber of secondssee values.yaml
readinessProbe.periodSecondsNumber of secondssee values.yaml
readinessProbe.successThresholdNumber of secondssee values.yaml
init.image.repositoryInit container image repositorybusybox
init.image.tagInit container image tag1.32.1
init.image.pullPolicyInit container image pull policyIfNotPresent
init.resourcesConfigure resource requests or limits for init container{}
init.securityContextSecurity context for init containersee values.yaml
autoscaling.enabledWhether to enable the HorizontalPodAutoscalerfalse
autoscaling.minReplicasMinimum number of replicas when autoscaling is enabled1
autoscaling.maxReplicasMaximum number of replicas when autoscaling is enabled100
autoscaling.targetCPUUtilizationPercentageTarget CPU utilisation percentage for autoscaling80
autoscaling.targetMemoryUtilizationPercentageTarget memory utilisation percentage for autoscalingnull
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
updateStrategyConfigure deployment update strategy{} (defaults to RollingUpdate)
affinityAffinity settings for pod assignment{}
extraEnvsAdditional environment variables to set in the NetBox container[]
extraVolumeMountsAdditional volumes to mount in the NetBox container[]
extraVolumesAdditional volumes to reference in pods[]
extraContainersAdditional sidecar containers to be added to pods[]
extraInitContainersAdditional init containers to run before starting main containers[]
workerWorker specific variables. Most global variables also apply here.see values.yaml
housekeeping.enabledWhether the HousekeepingCronJob should be activetrue
housekeeping.concurrencyPolicyConcurrencyPolicy for the Housekeeping CronJob.Forbid
housekeeping.failedJobsHistoryLimitNumber of failed jobs to keep in history5
housekeeping.restartPolicyRestart Policy for the Housekeeping CronJob.OnFailure
housekeeping.scheduleSchedule for the CronJob in Cron syntax.0 0 * * * (Midnight daily)
housekeeping.successfulJobsHistoryLimitNumber of successful jobs to keep in history5
housekeeping.suspendWhether to suspend the CronJobfalse
housekeeping.podAnnotationsAdditional annotations for housekeeping CronJob pods{}
housekeeping.podLabelsAdditional labels for housekeeping CronJob pods{}
housekeeping.podSecurityContextSecurity context for housekeeping CronJob podssee values.yaml
housekeeping.securityContextSecurity context for housekeeping CronJob containerssee values.yaml
housekeeping.resourcesConfigure resource requests or limits for housekeeping CronJob{}
housekeeping.nodeSelectorNode labels for housekeeping CronJob pod assignment{}
housekeeping.tolerationsToleration labels for housekeeping CronJob pod assignment[]
housekeeping.affinityAffinity settings for housekeeping CronJob pod assignment{}
housekeeping.extraEnvsAdditional environment variables to set in housekeeping CronJob[]
housekeeping.extraVolumeMountsAdditional volumes to mount in the housekeeping CronJob[]
housekeeping.extraVolumesAdditional volumes to reference in housekeeping CronJob pods[]
housekeeping.extraContainersAdditional sidecar containers to be added to housekeeping CronJob[]
housekeeping.extraInitContainersAdditional init containers for housekeeping CronJob pods[]

Specify each parameter using the --set key=value[,key=value] argument to helm install or provide a YAML file containing the values for the above parameters:

$ helm install --name my-release bootc/netbox --values values.yaml

Using an Existing Secret

Rather than specifying passwords and secrets as part of the Helm release values, you may pass these to NetBox using a pre-existing Secret resource. When using this, the Secret must contain the following keys:

KeyDescriptionRequired?
db_passwordThe password for the external PostgreSQL databaseIf postgresql.enabled is false and externalDatabase.existingSecretName is unset
email_passwordSMTP user passwordYes, but the value may be left blank if not required
ldap_bind_passwordPassword for LDAP bind DNIf remoteAuth.enabled is true and remoteAuth.backend is netbox.authentication.LDAPBackend
napalm_passwordNAPALM user passwordYes, but the value may be left blank if not required
redis_tasks_passwordPassword for the external Redis tasks databaseIf redis.enabled is false and tasksRedis.existingSecretName is unset
redis_cache_passwordPassword for the external Redis cache databaseIf redis.enabled is false and cachingRedis.existingSecretName is unset
secret_keyDjango secret key used for sessions and password reset tokensYes
superuser_passwordPassword for the initial super-user accountYes
superuser_api_tokenAPI token created for the initial super-user accountYes

Using extraConfig for S3 storage configuration

If you want to use S3 as your storage backend and not have the config in the values.yaml (credentials!) you can use an existing secret that is then referenced under the extraConfig key.

The secret would look like this:

apiVersion: v1kind: Secretmetadata:
labels:
app.kubernetes.io/instance: netboxname: netbox-extrastringData:
s3-config.yaml: | STORAGE_CONFIG: AWS_S3_ENDPOINT_URL: <endpoint-URL> AWS_S3_REGION_NAME: <region> AWS_STORAGE_BUCKET_NAME: <bucket-name> AWS_ACCESS_KEY_ID: <access-key> AWS_SECRET_ACCESS_KEY: <secret-key>

And the secret then has to be referenced like this:

extraConfig:
- secret: # same as pod.spec.volumes.secretsecretName: netbox-extra

Configuring SSO

You can leverage the extraConfig value in conjunction with remoteAuth to configure SSO. An example:

remoteAuth:
enabled: truebackend: social_core.backends.keycloak.KeycloakOAuth2autoCreateUser: falseextraConfig:
- values:
SOCIAL_AUTH_KEYCLOAK_KEY: 'netbox'SOCIAL_AUTH_KEYCLOAK_SECRET: 'HaveANiceDay'SOCIAL_AUTH_KEYCLOAK_PUBLIC_KEY: 'MII....'SOCIAL_AUTH_KEYCLOAK_AUTHORIZATION_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/auth'SOCIAL_AUTH_KEYCLOAK_ACCESS_TOKEN_URL: 'https://keycloak.yourdomain.com/auth/realms/YourRealm/protocol/openid-connect/token'SOCIAL_AUTH_KEYCLOAK_ID_KEY: 'email'SOCIAL_AUTH_JSONFIELD_ENABLED: True

Using LDAP Authentication

In order to enable LDAP authentication, please carry out the following steps:

  1. Set image.tag in your values to an image with LDAP support (e.g. v3.0.11-ldap)
  2. Configure the remoteAuth settings to enable the LDAP backend (see below)
  3. Make sure you set all of the remoteAuth.ldap settings shown in the values.yaml file

For example:

remoteAuth:
enabled: truebackend: netbox.authentication.LDAPBackendldap:
serverUri: 'ldap://domain.com'startTls: trueignoreCertErrors: truebindDn: ''bindPassword: ''# and ALL the other remoteAuth.ldap.* settings from values.yaml

Note: in order to use anonymous LDAP binding set bindDn and bindPassword to an empty string as in the example above.

License

The following notice applies to all files contained within this Helm Chart and the Git repository which contains it:

Copyright 2019-2020 Chris Boot

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

A Helm chart for NetBox

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages