Skip to main content

Upgrading Nexus Repository in a Kubernetes Environment

The following are instructions for upgrading your resilient or highly available (HA) Sonatype Nexus Repository deployment in a Kubernetes environment.

For Highly Available deployments, we recommend using Rolling Upgrades.

See Rolling Upgrades in High Availability

Using Zero-Downtime (Rolling) Upgrades

When doing a zero-downtime upgrade (available when upgrading to 3.72.0+), you can also use kubectl set image/undo rollout for rollouts and rollbacks.

See the Kubernetes documentation on rolling back a deployment.

Upgrading Using YAMLs Without Helm Charts

  1. (Step 1 is only required if not doing a rolling/zero-downtime upgrade, which is not available until upgrading to 3.72.0+)

    Scale replicas to "0" using the command below:

    kubectl get statefulsets <stateful-set-name>
    kubectl scale statefulsets <stateful-set-name> --replicas=0
  2. Update the statefulsets.yaml with the Sonatype Nexus Repository version to wish you which to upgrade. Look for a line like the following:

    image: sonatype/nexus3:<version>
  3. (Step 3 is only required if not doing a rolling/zero-downtime upgrade)

    Ensure the statefulset.yaml is set to include the desired number of replicas.

  4. Apply the updated statefulset.yaml:

    kubectl apply -f <updated-stateful-set-file>

Upgrading Using Helm Charts

This section covers upgrading Sonatype Nexus Repository using a Helm chart.

Updating to Helm Chart with Shared Logging

From Nexus Repository release 3.68.0 forward, the Helm chart uses a shared logging location. Before updating to a Nexus Repository 3.68.0+ Helm chart from an earlier version, download a support zip for each of your Nexus Repository instances.

  1. (Step 1 is only required if not doing a rolling/zero-downtime upgrade, which is not available until upgrading to 3.72.0+)

    Scale replicas to 0 using the command below:

    kubectl get statefulsets -n <namespace>
    kubectl scale statefulsets <stateful-set-name> --replicas=0 -n <namespace>
  2. Update your custom values.yaml to the desired Sonatype Nexus Repository version. Look for a line like the following:

    container:
        image:
        repository: sonatype/nexus3
        nexusTag: <version-number>
  3. Use an upgrade command like the ones below:

    1. If you installed from Sonatype Helm index:

      helm upgrade <release-name> sonatype/nxrm-ha
    2. If you installed directly from the Git repository:

      helm upgrade <release-name> nxrm3-ha-repository/nxrm-ha-helm -f values.yaml
  4. (Step 4 is only required if not doing a rolling/zero-downtime upgrade)

    Scale replicas to your desired number of replicas using a command like the one below:

    kubectl get statefulsets -n <namespace>
    kubectl scale statefulsets <stateful-set-name> --replicas=<number of replicas> -n <namespace>

Upgrading to the Combined Helm Chart

Before release 3.62.0, we offered separate Helm charts for AWS and Azure environments. As of release 3.62.0, we offer a single HA Helm chart (GitHubArtifactHub) to used in AWS, Azure, or on-premises deployments.

If you were previously using one of the separate Helm charts and will now be using the combined one, follow these steps:

Note

Note that the steps below are for upgrading from the AWS or Azure HA Helm charts and are not for migrating from the legacy OrientDB Helm chart. There is no direct path to migrate from the legacy OrientDB Helm chart. You will need to migrate to a PostgreSQL database to be able to use the HA helm chart.

  1. Before proceeding, back up your blob store.

  2. Uninstall the old Helm chart using a command like the following where <release-name> is the string you provided when first installing the chart:

    helm uninstall <release-name>
  3. Update the values.yaml for the new combined HA Helm Chart (GitHubArtifactHub). with appropriate settings for your deployment. Note that you will need to customize a new values.yaml with appropriate information for your deployment; you will not be able to use the same custom values.yaml that you used with the individual AWS/Azure Helm charts.

  4. Install the new Helm chart using a command like the following:

    helm install <release-name> --debug