nxrm-ha

by Sonatype

Helm chartv98.3.0App 3.98.3Apache-2.0Verified publisherOfficial

Resilient Deployment of Sonatype Nexus Repository - Universal Binary repository

About this chart

Helm Chart for High Availability (HA) and Resilient Deployments

This Helm chart configures the Kubernetes resources that are needed for HA or resilient Nexus Repository Pro deployments in AWS, Azure, or on-premises.

  • Have an idea for an improvement? Pro customers can submit ideas through Sonatype's Ideas portal.
  • If you encounter any problems/issues with the helm chart, please contact Sonatype support as [email protected]

NOTE: Sonatype does not support or plan to support using a Helm chart for deployments using embedded databases, which includes all OSS deployments. Using Kubernetes to manage an application with an embedded database is a leading cause of corruption, outages, and data loss.


Pre-requisites

Note: Before upgrading your Nexus Repository instance, review the Nexus Repository Release Notes to evaluate any potential breaking changes.

Also be sure to review our HA system requirements help documentation and ensure that each instance meets our normal Nexus Repository system requirements.

Nexus Repository Pro License

This Helm chart is designed for Sonatype Nexus Repository Pro deployments with a valid Pro license.

Sticky Sessions for Load Balancers/Ingress

NOTE: Configuration of sticky sessions is not supported in this chart. If you require sticky sessions, you will need to configure this in your load balancer or ingress controller as applicable.

Storage

Shared Storage Recommendation for Multi-AZ HA Deployments

For multi-availability zone (multi-AZ) HA deployments, Sonatype recommends dynamically provisioned network storage that is accessible from all availability zones (e.g., AWS EFS, Azure Files, NFS). This recommendation addresses a critical scheduling constraint with zonal block storage (e.g., AWS EBS, Azure Disk).

Why shared storage is recommended:

When using block storage like EBS, a PersistentVolumeClaim (PVC) is bound to a specific availability zone. If a pod must be rescheduled to a different AZ (due to node failure, maintenance, or scaling events), it cannot attach the PVC from the original AZ, causing the pod to fail to start. Network-accessible storage (EFS, Azure Files, NFS) eliminates this AZ-binding constraint, allowing pods to be scheduled on any node in any AZ within the cluster.

What "shared storage" means (and what it does NOT mean):

  • "Shared" means the storage infrastructure (the EFS file system, Azure Files share, or NFS server) is reachable from all eligible Kubernetes nodes across availability zones.
  • "Shared" does NOT mean all Nexus pods should mount and write to the same directory or use the same PVC. Each Nexus Repository pod requires its own dedicated, isolated storage location.

Per-pod isolation requirement:

Each Nexus pod must receive its own dynamically provisioned PVC (or isolated directory/access point on shared storage). Pods must not share the same Nexus work directory.

  • For AWS EFS: Use dynamic provisioning with EFS access points so that each pod receives its own isolated subdirectory. Configure your storage class with provisioningMode: efs-ap and set pvc.volumeClaimTemplate.enabled: true.
  • For Azure Files: Each pod receives its own dynamically provisioned Azure File share when pvc.volumeClaimTemplate.enabled: true.
  • For NFS: Use the NFS subdir external provisioner to dynamically create isolated subdirectories for each pod.

Do NOT use a pre-created common PVC:

  • Using pvc.existingClaim to mount a single PVC into all Nexus pods is not supported for HA deployments. The Nexus Repository work directory (/nexus-data) is not designed for multiple instances to write concurrently to the same location.
  • Always use dynamic provisioning (pvc.volumeClaimTemplate.enabled: true) for HA deployments.

Performance considerations:

Network file storage (EFS, Azure Files, NFS) can have different performance characteristics than block storage (EBS, Azure Disk). While EBS may offer more predictable and lower write latency, it introduces AZ-binding constraints that limit HA scheduling flexibility. The recommendation for EFS/Azure Files is primarily about resiliency and cross-AZ availability, not performance.

Reducing writes to persistent storage

If you use centralized log forwarding (e.g., Fluent Bit → CloudWatch, Splunk, etc.), you can configure Nexus Repository logs and temporary support content to use ephemeral storage (emptyDir) instead of the persistent volume. This reduces write traffic to your network storage and can improve performance. See Ephemeral Storage for Logs and Support Content below for configuration details.


Default Configuration

The default configuration uses an emptyDir volume for storing Nexus Repository logs. However, this is only for demonstration purposes. For production, we strongly recommend that you configure dynamic provisioning of persistent storage as described above.

Note: Versions 66.0.0 and older of this chart only supported local storage (e.g., EBS, Azure Disk, locally attached disks for on-prem deployments).

From version 68.0.0+, we recommend and support using shared storage (e.g., EFS, Azure File, NFS for on-prem deployments). However, this chart is still compatible with local storage.

Continuing to use EBS/Azure Disk/on-prem local disk storage in versions 68.0.0+ - (Not recommended)

If you wish to continue using EBS/Azure Disk/on-prem local disk storage, you can do so as follows:

  • Ensure the appropriate Container Storage Interface (CSI) driver(s) are installed on the Kubernetes cluster for your chosen cloud deployment.
  • Set pvc.volumeClaimTemplate.enabled to true
  • Set pvc.accessModes to ReadWriteOnce
  • Set pvc.storageSize to the desired size of the volume. E.g., 50Gi
  • To use a built-in storage class, set storageClass.name to gp2, managed-premium or premium-rwo for EKS, AKS and GKE respectively. For on-prem deployments specify the name of your custom storage class.
  • Set volumeBindingMode to WaitForFirstConsumer
  • Set reclaimPolicy to Retain or Delete depending on your requirements
  • To use a custom storage class, in addition to the above:
    • Set storageClass.enabled to true
    • Set the storageClass.provisioner to the appropriate value (see the documentation for your storage provider for more details). E.g., ebs.csi.aws.com, disk.csi.azure.com or pd.csi.storage.gke.io for EKS, AKS and GKE respectively. For on-prem deployments:see the CSI driver documentation for your storage provider E.g., for local static provisioner see https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner
    • Additional parameters can be set as needed for your custom storage class using the storageClass.parameters field.

Migrating from local storage (i.e., EBS/Azure Disk/local disk) to shared storage (i.e., EFS/Azure File/NFS) for storing Nexus Repository logs

If you have installed version 66.0.0 or older of the nxrm-ha chart and wish to switch to using shared storage for Nexus Repository logs, please do as follows:

  1. Back up all of your Nexus Repository pods' logs by logging in and generating a support zip for each one (see our support zip help documentation to learn how).
  2. Scale statefulset replicas to zero using commands like the following:
    • kubectl get statefulsets -n nexusrepo
    • kubectl scale statefulsets -n nexusrepo <stateful set name> --replicas=0
  3. After scaling statefulset replicas to zero, delete the statefulset using a command like the following: *kubectl delete statefulsets -n nexusrepo <stateful set name>
  4. Delete EBS/Azure disk/local disk PVCs using commands like the following:
    • kubectl get pvc -n nexusrepo
    • kubectl delete pvc -n nexusrepo <pvc 1> <pvc 2> <pvc n>
    • If you have a custom storage class for EBS PVC/PV pair, delete that storage class as well.
  5. Upgrade to the new version (68.0.0) of the nxrm-ha helm chart by taking the following steps:
    • Provision your shared storage (e.g., EFS/Azure File/NFS), and set appropriate permissions.
    • Update your custom values.yaml file for shared storage as detailed in the applicable section below for configuring dynamic persistent volume provisioning for your selected storage option.
    • Run helm upgrade: helm upgrade nxrm sonatype/nxrm-ha -f <your values.yaml> --version 68.0.0
    • Scale replicas as needed.
  6. Confirm all Nexus Repository pods start up and create new PVCs.
    • Confirm new PVCs were created and that they are bound appropriately depending on your configuration (i.e., EFS access points/Azure File shares/NFS mounts):
      • kubectl get pvc -n nexusrepo
      • kubectl describe pvc -n nexusrepo nexus-data-nxrm-nxrm-ha-0
      • kubectl describe pvc -n nexusrepo nexus-data-nxrm-nxrm-ha-1
      • Check that the volume.beta.kubernetes.io/storage-provisioner annotation in the PVC description is representative of your configuration (i.e., EFS/Azure File/NFS provisioner).
    • Confirm pods are up and running using commands like the following:
      • kubectl get pods -n nexusrepo
      • kubectl logs -n nexusrepo nxrm-nxrm-ha-0 -f
      • kubectl logs -n nexusrepo nxrm-nxrm-ha-1 -f
      • kubectl logs -n nexusrepo nxrm-nxrm-ha-2 -f

Migrating from statefulset.name to nameOverride/fullnameOverride

If you have used the statefulset.name parameter in version 87.1.0 or earlier, this parameter has been removed in favor of the standard Helm naming conventions.

What changed:

  • The statefulset.name parameter has been removed
  • Use nameOverride or fullnameOverride instead for controlling resource names

Migration steps:

  1. If you were using statefulset.name in your values.yaml, you need to update your configuration:

    Old configuration (version ≤ 87.1.0):

    statefulset:
      name: nxrm-statefulset
    

    New configuration (version ≥ 88.0.0):

    # Option 1: Use nameOverride (appends to release name)
    nameOverride: "nxrm-ha"
    # Results in: <release-name>-nxrm-ha
    
    # Option 2: Use fullnameOverride (complete name override)
    fullnameOverride: "nxrm-statefulset"
    # Results in: nxrm-statefulset
    
  2. Important: If you need to maintain the exact same StatefulSet name as before, use fullnameOverride with your previous statefulset.name value.

  3. Update your helm deployment with the new values:

    helm upgrade nxrm sonatype/nxrm-ha -f <your updated values.yaml> --version <new-version>
    

Cloud deployments (AWS/Azure/GCP)

On-premises deployments

  1. Set up an NFS server and make it accessible to all worker nodes in your Kubernetes cluster.
  2. See our documentation on on-premises high availability deployments using Kubernetes for more information

Ephemeral Storage for Logs and Support Content

By default, Nexus Repository logs (/nexus-data/log) and support content (/nexus-data/tmp) are stored inside the main nexus-data PVC. If you are already forwarding logs to a centralized system (e.g., AWS CloudWatch via Fluent Bit), you can redirect these paths to cheap, ephemeral (emptyDir) storage instead. This reduces PVC size requirements and storage costs, since the data does not need to survive a pod restart.

IMPORTANT: Ephemeral storage is wiped when a pod is restarted or rescheduled. Only enable these options if you have a log forwarding solution (e.g., Fluent Bit → CloudWatch) already in place. If you enable ephemeral log storage without a log forwarder, logs will be lost on pod restart.

Enabling ephemeral log storage

In your values.yaml, set:

ephemeralStorage:
  logs:
    enabled: true
    sizeLimit: "10Gi"      # adjust to your expected log volume
    path: "/nexus-data/log" # must be a subdirectory of /nexus-data

Enabling ephemeral support content storage

ephemeralStorage:
  supportContent:
    enabled: true
    sizeLimit: "50Gi"      

Deploy nxrm-ha with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has nxrm-ha on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartnxrm-ha is pinned at v98.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply