Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release chart v5.0.0 #286

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open

Release chart v5.0.0 #286

wants to merge 8 commits into from

Conversation

LeoColomb
Copy link
Member

@LeoColomb LeoColomb commented Jul 23, 2024

Opening this PR to move forward to chart v5. Kind of a recap of the 5.0.0 milestone.

To-do

Preview Give feedback
  1. documentation enhancement

After

Preview Give feedback
  1. pending
    RangerRick

Upgrade notes

NetBox has been updated to version 4.x. This chart should still work with 3.7.x as well by overriding the image, but it is not officially supported.

Potentially breaking changes

  • The extraContainers setting has been renamed sidecars to match conventions.
  • The extraInitContainers setting has been renamed initContainers to match conventions.
  • The metricsEnabled setting has been renamed metrics.enabled to match conventions.
  • The serviceMonitor setting has been moved to metrics.serviceMonitor to match conventions.
  • The jobResultRetention setting has been renamed jobRetention to match the change in more recent versions of NetBox.
  • The remoteAuth.backend setting has been renamed remoteAuth.backends and is now an array.
  • The remoteAuth.autoCreateUser setting now defaults to false.
  • NAPALM support has been moved into a plugin since NetBox 3.5, so all NAPALM-specific configuration has been removed from this chart.
  • Please consult the NetBox and netbox-docker release notes in case there are any other changes that may affect your configuration.
  • The Bitnami PostgreSQL sub-chart was upgraded from 10.x to 15.x; please read the upstream upgrade notes if you are using the bundled PostgreSQL.
  • The Bitnami Redis sub-chart was upgraded from 15.x to 20.x; please read the upstream upgrade notes if you are using the bundled Redis.

Migration Guide

Caution

We still suggest moving to an external, high-availability PostgreSQL and Redis, rather than continuing to use the built-in ones in the chart which exist primarily for ease of trying out a proof-of-concept. Managing PostgreSQL and Redis separately lets you manage them and their versioning outside of the chart release cycle.

That said, here are the steps you can take to move from the 4.x chart running NetBox 3.2.8 (or higher), to the 5.x chart.

Back Up the PostgreSQL Database

  1. Find the PostgreSQL pod:
    kubectl get pods -A | grep postgres
  2. Dump the database:
    kubectl exec -n <namespace> <pod_name> -- \
        pg_dump --format=custom \
          -cU postgres \
          -d "dbname=netbox" \
          > /tmp/postgresql/netbox.sql

Start a New Temporary PostgreSQL

You will need a temporary PostgreSQL so you can migrate the data before switching to the newer chart.

  1. Bring up a temporary PostgreSQL, either in your cluster using the chart of your choice (postgres-operator, Crunchy Postgres, etc.) or in another machine/VM/whatever.
    PostgreSQL 16 is the highest version supported by the Bitnami chart as of this writing, so if you intend to go back to the built-in chart after migrating, that's the recommended version to work with for now.

  2. Restore the database dump you made earlier into your new PostgreSQL.

    pg_restore -v -Fc -c -U netbox -d netbox < /tmp/netbox.sql
  3. Point NetBox at the temporary database.

    Once your temporary PostgreSQL is started and accessible, update the externalDatabase section of your values.yaml to match the new database and apply it, or update them using helm upgrade:

    helm upgrade netbox \
      --set `externalDatabase.host=your-host` \
      --set `externalDatabase.port=5432` \
      ...etc...

Upgrade to NetBox 3.5.9 (if starting with an older version)

If you are currently using a version older than 3.5.9, like the default value of 3.2.8 the current chart defines, then it's best to upgrade to that version first.
3.5.9 is the last release that supports the PostgreSQL 11 version that was provided with the 4.x charts.

  1. Take note of the warning about Deletion of Legacy Data in the NetBox release notes. You must either migrate ASN and contact changes to the new model, or set NETBOX_DELETE_LEGACY_DATA in your values.yaml to allow deletion anyway.
    extraEnvs:
      NETBOX_DELETE_LEGACY_DATA: "1"
    Alternately, you can use helm upgrade to update the chart with new settings:
    helm upgrade netbox --reuse-values \
      --set 'extraEnvs.NETBOX_DELETE_LEGACY_DATA=1'
    
  2. Upgrade to NetBox 3.5.9

Update the image to the 3.5.9 tag in values.yaml:

image:
  tag: "3.5.9"

Or, you can use helm upgrade to update in-place:

helm upgrade netbox --reuse-values \
  --set 'image.tag=3.5.9'

Note

You can pass more than one --set option, so you can combine the helm options when updating:

helm upgrade netbox --reuse-values \
  --set 'extraEnvs.NETBOX_DELETE_LEGACY_DATA=1' \
  --set 'image.tag=3.5.9'

Switch to the New Chart Repository

Note

It is recommended that you upgrade to the latest version of each minor release to make sure migrations run successfully, and give enough time for the migrations to finish running before moving to the next version.
Watch your pods and confirm everything is Running before doing the next step.

  1. Once NetBox is back up and talking to the new database, you can upgrade further until you are up-to-date.

    • 3.5.93.6.9
    • 3.6.93.7.8
    • 3.7.84.0.11
    • 4.0.114.1.8
  2. Switch to the new chart repository.

    helm upgrade netbox --reuse-values \
      oci://ghcr.io/netbox-community/netbox-chart/netbox

Caveats

Don't forget to check the potentially breaking changes up above.
You may need to re-set some values to match the new schema.

If you are using other tools alongside Helm (like ArgoCD), you might run into additional issues. See issue #450 for details.

@RangerRick
Copy link
Contributor

@LeoColomb Ah thanks! Been meaning to start organizing this now that I've come out from under the flurry of initial development on the NBE chart.

@RangerRick RangerRick disabled auto-merge October 22, 2024 20:11
@LeoColomb LeoColomb enabled auto-merge (rebase) October 22, 2024 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants