Overview:
Sonatype have deprecated the standalone helm3 charts to deploy nexus 3 instances as newer nexus HA helm charts were introduced. This article explains how to deploy a newer standalone nexus instance using nxrm-ha helm chart.
Note: nxrm-ha helm chart uses statefulset, with per pod storage assigned for local data. Thus we need to create an additional Persistent Storage for blobstore. If you are planning to convert this deployment to HA in future, preferably use a shared storage for blobstore (NFS / EFS etc).
PreRequisites:
- Kubernetes 1.21+ cluster (EKS / AKS / GKE)
- kubectl
- Helm 3
- External Postgresql DB for nexus instance
- Valid Nexus Repository Pro license file
Deploying Nexus Repository
- Install / Update Sonatype Helm3 charts
$ helm repo add sonatype https://sonatype.github.io/helm3-charts/
"sonatype" has been added to your repositories
$ helm repo update sonatype
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "sonatype" chart repository
Update Complete. ⎈Happy Helming!⎈
$ helm search repo sonatype
NAME CHART VERSION APP VERSION DESCRIPTION
sonatype/nexus-iq-server 184.0.0 1.184.0 Sonatype Nexus IQ Server continuously monitors ...
sonatype/nexus-iq-server-ha 184.0.0 1.184.0 A cluster of Sonatype Nexus IQ Servers to conti...
sonatype/nexus-repository-manager 64.2.0 3.64.0 DEPRECATED Sonatype Nexus Repository Manager - ...
sonatype/nxrm-aws-resiliency 64.2.0 3.64.0 DEPRECATED Resilient AWS Deployment of Sonatype...
sonatype/nxrm-ha 74.0.0 3.74.0 Resilient Deployment of Sonatype Nexus Reposito...
sonatype/nxrm-ha-aws 61.0.3 3.61.0 DEPRECATED Resilient AWS Deployment of Sonatype...
sonatype/nxrm-ha-azure 61.0.3 3.61.0 DEPRECATED Resilient Azure Deployment of Sonaty...
- Create a dedicated namespace
$ kubectl create namespace nexusrepo
namespace/nexusrepo created
Note: This example uses nfs storage provisioner, but change the same to suite your local storage provisioner.
- Create a Persistent Storage for Blobstore.
$ cat <<EOF3 | kubectl apply -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nfs-blob-pvc
namespace: nexusrepo
spec:
accessModes:
- ReadWriteMany
storageClassName: nfs
resources:
requests:
storage: 100Gi
EOF3
persistentvolumeclaim/nfs-blob-pvc created
- Create a custom values.yaml file mounting the Blobstore PVC under /nexus-data/blobs (default blob dir) or preferred directory (Note clustered option is set to false and replicaCount should be 1 for standalone deployments)
$ more nfs-blob-values.yaml
statefulset:
clustered: false
replicaCount: 1
additionalVolumes:
- name: nfs-blob
persistentVolumeClaim:
claimName: nfs-blob-pvc
additionalVolumeMounts:
- name: nfs-blob
mountPath: "/nexus-data/blobs"
Note: Attached an example nfs-blob-values.yaml file with most options to deploy nexus.
- Deploy nexus using the created values.yaml file and nxrm-ha chart.
Note: Below example assumes license file is named as nx-license.lic and present on current dir. Modify the command to your local license file name and location.
$ helm install nx3 -n nexusrepo -f ./nfs-blob-values.yaml \
--set secret.license.licenseSecret.enabled=true \
--set-file secret.license.licenseSecret.file=./nx-license.lic \
sonatype/nxrm-ha
NAME: nx3
LAST DEPLOYED: Tue Nov 26 16:47:14 2024
NAMESPACE: nexusrepo
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Thank you for installing nxrm-ha.
- Access the Nexus UI and configure nexus