nxrm-ha
by Sonatype
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-apand setpvc.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.existingClaimto 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.enabledtotrue - Set
pvc.accessModestoReadWriteOnce - Set
pvc.storageSizeto the desired size of the volume. E.g.,50Gi - To use a built-in storage class, set
storageClass.nametogp2,managed-premiumorpremium-rwofor EKS, AKS and GKE respectively. For on-prem deployments specify the name of your custom storage class. - Set
volumeBindingModetoWaitForFirstConsumer - Set
reclaimPolicytoRetainorDeletedepending on your requirements - To use a custom storage class, in addition to the above:
- Set
storageClass.enabledtotrue - Set the
storageClass.provisionerto the appropriate value (see the documentation for your storage provider for more details). E.g.,ebs.csi.aws.com,disk.csi.azure.comorpd.csi.storage.gke.iofor EKS, AKS and GKE respectively. For on-prem deployments:see the CSI driver documentation for your storage providerE.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.parametersfield.
- Set
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:
- 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).
- Scale statefulset replicas to zero using commands like the following:
kubectl get statefulsets -n nexusrepokubectl scale statefulsets -n nexusrepo <stateful set name> --replicas=0
- After scaling statefulset replicas to zero, delete the statefulset using a command like the following:
*
kubectl delete statefulsets -n nexusrepo <stateful set name> - Delete EBS/Azure disk/local disk PVCs using commands like the following:
kubectl get pvc -n nexusrepokubectl 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.
- 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.
- 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 nexusrepokubectl describe pvc -n nexusrepo nexus-data-nxrm-nxrm-ha-0kubectl describe pvc -n nexusrepo nexus-data-nxrm-nxrm-ha-1- Check that the
volume.beta.kubernetes.io/storage-provisionerannotation 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 nexusrepokubectl logs -n nexusrepo nxrm-nxrm-ha-0 -fkubectl logs -n nexusrepo nxrm-nxrm-ha-1 -fkubectl logs -n nexusrepo nxrm-nxrm-ha-2 -f
- 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):
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.nameparameter has been removed - Use
nameOverrideorfullnameOverrideinstead for controlling resource names
Migration steps:
-
If you were using
statefulset.namein your values.yaml, you need to update your configuration:Old configuration (version ≤ 87.1.0):
statefulset: name: nxrm-statefulsetNew 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 -
Important: If you need to maintain the exact same StatefulSet name as before, use
fullnameOverridewith your previousstatefulset.namevalue. -
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)
- Ensure the appropriate Container Storage Interface (CSI) driver(s) are installed on the Kubernetes cluster for your chosen cloud deployment.
- For AWS, see our documentation on high availability deployments in AWS
- For Azure, see our documentation on high availability deployments in Azure
- For GCP, see our documentation on high availability deployments in GCP
On-premises deployments
- Set up an NFS server and make it accessible to all worker nodes in your Kubernetes cluster.
- 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartnxrm-ha is pinned at v98.3.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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