Upgrading
Upgrade procedures for the netbox-enterprise Helm chart
Installation Journey Prerequisites → Install → Upgrading (you are here)
How to upgrade a Helm install of NetBox Enterprise from 2.4.x to 2.5.0. For Embedded Cluster installs, see Upgrading on Embedded Cluster.
Plan a maintenance window
Upgrades are not zero-downtime, on any number of nodes. On every NetBox Enterprise upgrade, including one that keeps the same NetBox version, the operator stops NetBox before database migrations run and starts it again once they finish. Duration depends on the release and database size, so schedule upgrades in a maintenance window.
What changes in 2.5.0
| If you... | Then | When |
|---|---|---|
Upgrade with --reuse-values | It fails, because 2.4.x has no operator.coreImageTag. Pass your values file, or use --reset-then-reuse-values. Step 4 | During |
Use the NetBox Healthcheck plugin with custom checks | Fix old check names, or NetBox will not start. Details | Before |
| Have no NetBox Assurance license | Allow extra time. Diode rebuilds an index before it processes data. | Before |
Set CAs with extraCaCertificates or tlsKeychain, and have webhooks whose CA File Path points to one of them | Change it to /run/ca-bundle/ca-certificates.crt. | After |
| Created API tokens with background bulk requests | Replace those tokens. Details | After |
| Bookmark netbox-lifecycle pages | Update the bookmarks. The page paths changed. | After |
Also new: the identity stack stays off until you turn it on; on Helm it needs Gateway routing and more memory. Full list: 2.5.0 Upgrade Notes.
1. Prepare
-
You have done the Before items that apply to you in What changes in 2.5.0.
-
All components are healthy:
kubectl -n netbox get netboxenterprises kubectl -n netbox get pods -
Coming from 2.2.x or earlier: read Coming from an older version first.
-
Using external services: check the table below.
External services
No chart check covers these versions, so check by hand.
| Service | Check | Back up |
|---|---|---|
| PostgreSQL | SELECT version(); shows 15 or later. The NetBox role can run CREATE EXTENSION ltree. See External Database. | Back up each database with your own tools. The disaster recovery backup does not hold them. |
| Redis | INFO server shows redis_version 6.0 or later. | |
| S3 | Turn on bucket versioning or take a snapshot if you want a rollback point for media. |
2. Back up
- Take a PostgreSQL backup. Set
NS,PGCLUSTERandREPO_HOSTfirst, as in Verify that both kinds of backup work. This is what you roll back to. External PostgreSQL: use your own copy instead. - Take a disaster recovery backup.
3. Upgrade the CRDs
Upgrade the CRD charts before the operator, or the operator can fail to validate the NetBoxEnterprise resource. If you installed the CRD charts in a namespace other than netbox, pass that one (see Namespace-Scoped Installation).
REGISTRY=oci://registry.enterprise.netboxlabs.com/netbox-enterprise/stable-v2
VERSION=2.5.0
helm upgrade netbox-enterprise-crds "$REGISTRY/netbox-enterprise-crds" \
--version "$VERSION" --namespace netbox
# Skip either chart if you use external PostgreSQL or external Redis.
for CHART in netbox-enterprise-crds-pgo netbox-enterprise-crds-redis; do
helm upgrade "$CHART" "$REGISTRY/$CHART" --version "$VERSION" --namespace netbox
done
# Only if you use the bundled Keycloak (idp.enabled: true). New in 2.5.0.
helm upgrade --install netbox-enterprise-crds-keycloak \
"$REGISTRY/netbox-enterprise-crds-keycloak" --version "$VERSION" --namespace netbox
# Only if you installed the bundled gateway.
for CHART in netbox-enterprise-crds-gateway netbox-enterprise-crds-traefik; do
helm upgrade "$CHART" "$REGISTRY/$CHART" --version "$VERSION" --namespace netbox
doneError: UPGRADE FAILED: "<release>" has no deployed releases means you never installed that chart. Skip it.
4. Upgrade the operator
Pass your full values file:
helm upgrade netbox-enterprise \
oci://registry.enterprise.netboxlabs.com/netbox-enterprise/stable-v2/netbox-enterprise \
--version 2.5.0 --namespace netbox --values netbox-values.yamlNo values file? Use --reset-then-reuse-values instead of --values (Helm 3.14 or later).
Do not use --reuse-values from a release before 2.5.0
It fails with operator.coreImageTag must be the nbe-core image tag the operator deploys (NBE-3241), because earlier releases have no value for the new operator.coreImageTag. The release stays on its old version. Run this step again with your values file or --reset-then-reuse-values, and do not add --reuse-values to it.
5. Confirm it finished
helm upgrade --wait returns before the upgrade finishes: about 4 minutes early in our test. The upgrade is done when this prints the new version and true:
kubectl -n netbox get netboxenterprises \
-o jsonpath='{.items[0].status.version} {.items[0].status.ready}{"\n"}'2.5.0 trueDon't rely on kubectl rollout status deployment -l ... (the label form) during the upgrade. The operator deletes and recreates the NetBox Deployment, and while it is gone that form prints No resources found and still exits 0.
To follow progress, watch the operator log: kubectl -n netbox logs deployment/netbox-enterprise -f --tail=50. If it stalls, see Troubleshooting.
Rollback
helm rollback does not undo database migrations. Restore your pre-upgrade database too. You lose changes made since that backup.
-
Turn on maintenance mode with the
kubectl patchcommand in Maintenance Mode. Use the patch, not a values change, so it stays on through the rollback. We tested this with Helm 3, not Helm 4. -
Restore the database to the backup you took in step 2, and leave maintenance mode on.
- Built-in PostgreSQL: do steps 1 to 6 of PostgreSQL restore to an earlier point, with
optionsset to["--type=immediate", "--set=<backup label>"]. Skip its step 3, because maintenance mode is already on. Stop before its step 7. - External PostgreSQL: restore your own copy of each database.
- Built-in PostgreSQL: do steps 1 to 6 of PostgreSQL restore to an earlier point, with
-
Roll back the release:
helm history netbox-enterprise --namespace netbox helm rollback netbox-enterprise <revision-number> --namespace netbox -
Turn off maintenance mode, then run the check in step 5. It prints your earlier version and
true. -
Built-in PostgreSQL: finish steps 8 and 9 of the restore procedure. Step 9 takes a full PostgreSQL backup on the new timeline. Without it, a later disaster recovery restore can fail with
ERROR: [058].
Keep maintenance mode on until the rollback is done. If NetBox starts on 2.5.0 against the restored database, it applies 2.5.0 migrations, such as plugin migrations, before the rollback. Leave the CRD charts on 2.5.0: the 2.4.x operator works with them.
Suspend Reconciliation
To pause the operator during troubleshooting without rolling back, run the step 4 command with --set netboxEnterprise.spec.suspend=true. Existing workloads keep running. Set it back to false to resume.
Coming from an older version
Skip this section if you are upgrading from 2.3.x or later.
One-time CRD adoption from 2.2.x or earlier
Skip this if you are on 2.3.0 or later.
Releases before 2.3.0 installed CRDs without Helm ownership metadata. The first upgrade of these charts to 2.3.0 or later must adopt them with --take-ownership (Helm 3.17 or later), or it stops with invalid ownership metadata. Nothing is applied when that happens, so you can retry.
| Chart | First upgrade to 2.3.0 or later |
|---|---|
netbox-enterprise-crds | no flag needed |
netbox-enterprise-crds-pgo | add --take-ownership |
netbox-enterprise-crds-redis | add --take-ownership |
netbox-enterprise-crds-gateway | add --take-ownership, if installed, after the check below |
netbox-enterprise-crds-traefik | add --take-ownership, if installed, after the check below |
Do not skip netbox-enterprise-crds: the operator needs its garageclusters.netboxlabs.com and garagenodes.deuxfleurs.fr CRDs even with in-cluster object storage off. Check with kubectl get crd garageclusters.netboxlabs.com garagenodes.deuxfleurs.fr.
Rehearse first. A dry run shows the ownership error without changing anything. Use a chart you have, other than netbox-enterprise-crds:
helm upgrade netbox-enterprise-crds-redis \
oci://registry.enterprise.netboxlabs.com/netbox-enterprise/stable-v2/netbox-enterprise-crds-redis \
--version 2.5.0 --namespace netbox --dry-runCheck who owns the Gateway API and Traefik CRDs before adopting them
--take-ownership adopts a CRD whoever installed it. If Istio, Cilium, Envoy Gateway or your own Traefik installed the gateway.networking.k8s.io or traefik.io CRDs, adopting them replaces their schema and breaks that owner's upgrades. Check every CRD, not a sample:
for crd in backendtlspolicies gatewayclasses gateways grpcroutes \
httproutes listenersets referencegrants tlsroutes; do
printf '%-24s %s\n' "$crd" \
"$(kubectl get crd "$crd.gateway.networking.k8s.io" \
-o jsonpath='{.metadata.annotations.meta\.helm\.sh/release-name}' 2>/dev/null || echo '(absent)')"
done
for crd in ingressroutes ingressroutetcps ingressrouteudps middlewares \
middlewaretcps serverstransports serverstransporttcps \
tlsoptions tlsstores traefikservices; do
printf '%-24s %s\n' "$crd" \
"$(kubectl get crd "$crd.traefik.io" \
-o jsonpath='{.metadata.annotations.meta\.helm\.sh/release-name}' 2>/dev/null || echo '(absent)')"
doneEvery line must be blank, (absent), or netbox-enterprise-crds-gateway / netbox-enterprise-crds-traefik. If any line names another release, do not adopt that chart: leave it on its current version. Its CRDs have not changed from 2.2.1 to 2.5.0, so you miss nothing.
Adoption is one time. Do not keep --take-ownership in a runbook: it turns off Helm's ownership check on every run. Existing custom resources are not changed.
To confirm adoption landed, list any CRD that is still unowned. Empty output means done:
kubectl get crd -o json | jq -r '
.items[]
| select(.metadata.name | test("opstreelabs.in$|crunchydata.com$|gateway.networking.k8s.io$|traefik.io$|netboxlabs.com$"))
| select(.metadata.annotations["meta.helm.sh/release-name"] == null)
| .metadata.name'Helm older than 3.17
Older clients reject --take-ownership with unknown flag. Apply the same metadata with kubectl, then upgrade without the flag. Name each CRD; do not select a whole group, since other controllers' CRDs can share it.
NAMESPACE=netbox
adopt() { # adopt <release> <crd>...
local release=$1; shift
for crd in "$@"; do
kubectl label crd "$crd" app.kubernetes.io/managed-by=Helm --overwrite
kubectl annotate crd "$crd" \
meta.helm.sh/release-name="$release" \
meta.helm.sh/release-namespace="$NAMESPACE" --overwrite
done
}
adopt netbox-enterprise-crds-pgo \
pgadmins.postgres-operator.crunchydata.com \
pgupgrades.postgres-operator.crunchydata.com \
postgresclusters.postgres-operator.crunchydata.com
adopt netbox-enterprise-crds-redis \
redis.redis.redis.opstreelabs.in \
redisclusters.redis.redis.opstreelabs.in \
redisreplications.redis.redis.opstreelabs.in \
redissentinels.redis.redis.opstreelabs.in
# Only if you installed the bundled gateway, after the ownership check above.
adopt netbox-enterprise-crds-gateway \
backendtlspolicies.gateway.networking.k8s.io \
gatewayclasses.gateway.networking.k8s.io \
gateways.gateway.networking.k8s.io \
grpcroutes.gateway.networking.k8s.io \
httproutes.gateway.networking.k8s.io \
listenersets.gateway.networking.k8s.io \
referencegrants.gateway.networking.k8s.io \
tlsroutes.gateway.networking.k8s.io
adopt netbox-enterprise-crds-traefik \
ingressroutes.traefik.io \
ingressroutetcps.traefik.io \
ingressrouteudps.traefik.io \
middlewares.traefik.io \
middlewaretcps.traefik.io \
serverstransports.traefik.io \
serverstransporttcps.traefik.io \
tlsoptions.traefik.io \
tlsstores.traefik.io \
traefikservices.traefik.ioNAMESPACE and each release name must match your Helm releases.
Upgrading directly from 2.0.x
A Helm install that runs 2.0.x keeps two settings from 2.0.x on its NetBox web Deployment: an HTTP liveness probe and a postStart hook that runs collectstatic. When it upgrades directly to 2.2.0 or later, the operator can fail to replace them. The NetBoxEnterprise resource then stays at Ready=False with reason ReconcileFailed, and new NetBox pods can fail on the old postStart hook. The install does not recover by itself, so do these steps in order.
Upgrading to 2.1.2 first, then to your target version, avoids this step.
Installs first created on 2.1.x upgrade without this step, and so do installs first created on 2.2.0 or later and installs first created on 2.0.x that already run 2.1.x.
If you already upgraded and the NetBoxEnterprise resource shows the error in step 4, go to step 5.
-
Check whether the step applies to you. Before you upgrade, check the chart version your install runs, then print the
postStarthook of the NetBox web Deployment:helm -n netbox list kubectl -n netbox get deployment netbox-netbox \ -o jsonpath='{.spec.template.spec.containers[0].lifecycle.postStart}{"\n"}'Continue with this section only if
helm listshows thenetbox-enterprisechart at 2.0.x and the second command's output namescollectstatic. Otherwise, skip this section and upgrade as usual. -
Adopt the PostgreSQL and Redis CRDs, then upgrade the CRD charts. If your target is 2.3.0 or later, an install from 2.0.x needs the one-time adoption step for
netbox-enterprise-crds-pgoandnetbox-enterprise-crds-redis. The gateway and traefik CRD charts first shipped in 2.2.0, so a 2.0.x install has no release of them to adopt. Pass--take-ownershiponce to those twohelm upgradecommands in Upgrade the CRDs, or, on Helm older than 3.17, adopt them withkubectlas shown in Helm older than 3.17. -
Upgrade the operator as shown in Upgrade the operator. If your values file pins an image tag from 2.0.x, remove it first. The 2.5.0 charts need Kubernetes 1.33 or later; see Prerequisites.
-
Wait for the reconcile error. About 5 minutes after the upgrade, the operator reports that it cannot update the NetBox Deployment. Check the
Readycondition:kubectl -n netbox get netboxenterprise netbox \ -o jsonpath='{.status.conditions[?(@.type=="Ready")].reason}: {.status.conditions[?(@.type=="Ready")].message}{"\n"}'The output starts with
ReconcileFailedand contains this error:spec.template.spec.containers[0].livenessProbe.tcpSocket: Forbidden: may not specify more than 1 handler typeWait for this error before you delete anything. If you deleted the Deployments before it appeared, delete them again once it shows. Until the operator's first reconcile,
Readycan still show the pre-upgradeAllComponentsReady. If, about 5 minutes after the upgrade,ReadyshowsAllComponentsReadyandkubectl -n netbox get netboxenterprises -o jsonpath='{.items[0].status.version}'prints the new version, the upgrade is complete; skip step 5. -
Delete the NetBox web and worker Deployments. The operator recreates both on the new version:
kubectl -n netbox delete deployment netbox-netbox netbox-netbox-workerExpect about 2 minutes without the NetBox web UI, and up to 6. When the
Readycondition from the previous step showsAllComponentsReady, the upgrade is complete. You do not need this step again on later upgrades.
Replace netbox with your namespace, and netbox in netboxenterprise netbox with the name of your NetBoxEnterprise resource. The Deployments are named after that resource: <name>-netbox and <name>-netbox-worker.