.
Overview
Nexus HA deployments require shared storage for blobstores. Generally on cloud deployments we recommend to use Cloud storage like S3 or Azure Blob Storage. For on-premises deployments customers can use NFS storage for blobstore.
PreRequisites:
- Kubernetes 1.19+
- kubectl
- Helm 3
- External Postgresql DB version 13+
- A Nexus Repository Pro license file
- NFS / NFS client storage class configured and dynamic provisioning enabled
This document expects underlying kubernetes cluster to have corresponding nfs storage class already configured and dynamic provisioning is enabled. Configuring NFS storage class is outside the scope of this document and would recommend to reach out to corresponding kubernetes admin team for further assistance. Below link can be used as reference.
https://github.com/sonatype/nxrm3-ha-repository/tree/main/nxrm-ha#on-premises
Deploying NFS dynamic volume for blobstore
- Install Sonatype Helm3 charts
$ helm repo add sonatype https://sonatype.github.io/helm3-charts/
"sonatype" has been added to your repositories
- Create nexusrepo namespace (default namespace used by our helm chart, change if required)
$ kubectl create ns nexusrepo
namespace/nexusrepo created - Create a NFS Persistent Volume Claim using NFS storage class
$ more nfs-blob-pvc.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: nfs-blob-pvc
spec:
storageClassName: "nfs"
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1G
$ kubectl apply -f nfs-blob-pvc.yaml -n nexusrepo
persistentvolumeclaim/nfs-blob-pvc created
Deploy nexus HA with provisioned NFS volume.
- Create a values.yaml file with additionalVolumes and additionalVolumeMounts values
$ more values.yaml
namespaces:
nexusNs:
enabled: false
name: "nexusrepo"
statefulset:
replicaCount: 1
additionalVolumes:
- name: nfs-blob
persistentVolumeClaim:
claimName: nfs-blob-pvc
additionalVolumeMounts:
- name: nfs-blob
mountPath: "/nfs-blob"
container:
resources:
# See help documentation, these are minimum system requirements
requests:
cpu: 4
memory: "8Gi"
limits:
cpu: 4
memory: "8Gi"
env:
nexusDBName: nexushadb
nexusDBPort: 5432
storageClass:
enabled: false # For built-in storage class, set storageClass.enabled to false
name: nfs
pvc:
accessModes: ReadWriteOnce
storage: 50Gi
volumeClaimTemplate:
enabled: true
secret:
dbSecret:
enabled: true
db:
user: nexus
password: nexus123
host: postgres-svc.tools
nexusAdminSecret:
enabled: true # Enable to apply nexus-admin-secret.yaml which allows you to the initial admin password for nexus repository
adminPassword: admin123 #You should change this when you login for the first time
license:
name: nexus-repo-license.lic
licenseSecret:
enabled: true
# Replace below value with base64 of your license file
fileContentsBase64: "cylwwtYx..rTXMf1RKDj/+U673QW+NpJxp/Q=="
service:
nexus:
enabled: true
- Deploy helm chart
$ helm install nxha1 -f values.yaml -n nexusrepo sonatype/nxrm-ha
NAME: nxha1
LAST DEPLOYED: Mon Jun 17 11:24:09 2024
NAMESPACE: nexusrepo
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Thank you for installing nxrm-ha.
Nexus HA instances would be deployed with additional shared NFS volume mounted under /nfs-blob directory, as per above config.
Configure Shared Blob Store.
- Login to nexus HA UI as admin user (use admin123 as admin password, as configured in above values.yaml file)
- Go to Administration --> Repository --> Blobstore
- Click "Create Blob Store" and select File Type
- Enter desired blobstore name and change the Path value to be under /nfs-blob mount point
- Once Blob store is created. Create Repositories using this blobstore.
Please note, in HA environments shared blobstore needs to be configured before collecting support zip.