sonatype-nexus

by joaquinito2051

Helm chartv1.18.2App 3.15.2-01

Sonatype Nexus is an open source repository manager

About this chart

Nexus

Nexus OSS is a free open source repository manager. It supports a wide range of package formats and it's used by hundreds of tech companies.

Introduction

This chart bootstraps a Nexus OSS deployment on a cluster using Helm. This setup is best configured in GCP since:

There is also the option of using a proxy for Nexus that authenticates Nexus against an external identity provider (only GCP IAM at the moment) which is disabled by default.

Prerequisites

With GCP IAM enabled

All the Prerequisites should be in place, plus:

Testing the Chart

To test the chart:

$ helm install --dry-run --debug ./

To test the chart with your own values: $ helm install --dry-run --debug ./

$ helm install --dry-run --debug -f my_values.yaml ./

$ helm install --dry-run --debug -f my_values.yaml ./

Installing the Chart

To install the chart:

$ helm install <helm-repo>/sonatype-nexus

$ helm install stable/sonatype-nexus The above command deploys Nexus on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

The default login is admin/admin123

Uninstalling the Chart

To uninstall/delete the deployment:

$ helm list
NAME           	REVISION	UPDATED                 	STATUS  	CHART      	NAMESPACE
plinking-gopher	1       	Fri Sep  1 13:19:50 2017	DEPLOYED	sonatype-nexus-0.1.0	default
$ helm delete plinking-gopher

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the Nexus chart and their default values.

ParameterDescriptionDefault
statefulset.enabledUse statefulset instead of deploymentfalse
replicaCountNumber of Nexus service replicas1
deploymentStrategyDeployment StrategyrollingUpdate
nexus.imageNameNexus imagequay.io/travelaudience/docker-nexus
nexus.imageTagVersion of Nexus3.15.2
nexus.imagePullPolicyNexus image pull policyIfNotPresent
nexus.envNexus environment variables[{install4jAddVmParams: -Xms1200M -Xmx1200M -XX:MaxDirectMemorySize=2G -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap}]
nexus.resourcesNexus resource requests and limits{}
nexus.dockerPortPort to access docker5003
nexus.nexusPortInternal port for Nexus service8081
nexus.service.typeService for NexusNodePort
nexus.service.clusterIpSpecific cluster IP when service type is cluster IP. Use None for headless servicenil
nexus.securityContextSecurity Context (for enabling official image use fsGroup: 2000){}
nexus.labelsService labels{}
nexus.podAnnotationsPod Annotations{}
nexus.livenessProbe.initialDelaySecondsLivenessProbe initial delay30
nexus.livenessProbe.periodSecondsSeconds between polls30
nexus.livenessProbe.failureThresholdNumber of attempts before failure6
nexus.livenessProbe.timeoutSecondsTime in seconds after liveness probe times outnil
nexus.livenessProbe.pathPath for LivenessProbe/
nexus.readinessProbe.initialDelaySecondsReadinessProbe initial delay30
nexus.readinessProbe.periodSecondsSeconds between polls30
nexus.readinessProbe.failureThresholdNumber of attempts before failure6
nexus.readinessProbe.timeoutSecondsTime in seconds after readiness probe times outnil
nexus.readinessProbe.pathPath for ReadinessProbe/
nexus.hostAliasesAliases for IPs in /etc/hosts[]
nexusProxy.enabledEnable nexus proxytrue
nexusProxy.svcNameNexus proxy service namenil
nexusProxy.targetPortContainer Port for Nexus proxy8080
nexusProxy.portPort for exposing Nexus8080
nexusProxy.imageNameProxy imagequay.io/travelaudience/docker-nexus-proxy
nexusProxy.imageTagProxy image version2.4.0_8u191
nexusProxy.imagePullPolicyProxy image pull policyIfNotPresent
nexusProxy.resourcesProxy resource requests and limits{}
nexusProxy.env.nexusHttpHostNexus url to access Nexusnil
nexusProxy.env.nexusDockerHostContainers url to be used with dockernil
nexusProxy.env.enforceHttpsAllow only https access or notfalse
nexusProxy.env.cloudIamAuthEnabledEnable GCP IAM authentication in Nexus proxyfalse
nexusProxyRoute.enabledSet to true to create route for additional servicefalse
nexusProxyRoute.labelsLabels to be added to proxy route{}
nexusProxyRoute.annotationsAnnotations to be added to proxy route{}
nexusProxyRoute.pathHost name of Route e.g jenkins.example.comnil
persistence.enabledCreate a volume for storagetrue
persistence.accessModeReadWriteOnce or ReadOnlyReadWriteOnce
persistence.storageClassStorage class of Nexus PVCnil
persistence.storageSizeSize of Nexus data volume8Gi
persistence.annotationsPersistent Volume annotations{}
persistence.existingClaimExisting persistent volume namenil
nexusBackup.enabledNexus backup processfalse
nexusBackup.imageNameNexus backup imagequay.io/travelaudience/docker-nexus-backup
nexusBackup.imageTagNexus backup image version1.4.0
nexusBackup.imagePullPolicyBackup image pull policyIfNotPresent
nexusBackup.env.targetBucketRequired if nexusBackup is enabled. Google Cloud Storage bucker for backups format gs://BACKUP_BUCKETnil
nexusBackup.nexusAdminPasswordNexus admin password used by the backup container to access Nexus API. This password should match the one that gets chosen by the user to replace the default admin password after the first loginadmin123
nexusBackup.persistence.enabledCreate a volume for backing Nexus configurationtrue
nexusBackup.persistence.accessModeReadWriteOnce or ReadOnlyReadWriteOnce
nexusBackup.persistence.storageClassStorage class of Nexus backup PVCnil
nexusBackup.persistence.storageSizeSize of Nexus backup data volume8Gi
nexusBackup.persistence.annotationsPV annotations for backup{}
nexusBackup.persistence.existingClaimExisting PV name for backupnil
ingress.enabledCreate an ingress for Nexustrue
ingress.annotationsAnnotations to enhance ingress configuration{}
ingress.tls.enabledEnable TLStrue
ingress.tls.secretNameName of the secret storing TLS cert, false to use the Ingress' default certificatenexus-tls
ingress.pathPath for ingress rules. GCP users should set to /*/
tolerationstolerations list[]
config.enabledEnable configmapfalse
config.mountPathPath to mount the config/sonatype-nexus-conf
config.dataConfigmap datanil
deployment.annotationsAnnotations to enhance deployment configuration{}
deployment.initContainersInit containers to run before main containersnil
deployment.postStart.commandCommand to run after starting the nexus containernil
deployment.additionalContainersAdd additional Containernil
deployment.additionalVolumesAdd additional Volumesnil
deployment.additionalVolumeMountsAdd additional Volume mountsnil
secret.enabledEnable secretfalse
secret.mountPathPath to mount the secret/etc/secret-volume
secret.readOnlySecret readonly statetrue
secret.dataSecret datanil
service.enabledEnable additional servicenil
service.nameService namenil
service.portNameService port namenil
service.labelsService labelsnil
service.annotationsService annotationsnil
service.targetPortService portnil
service.portPort for exposing servicenil
route.enabledSet to true to create route for additional servicefalse
route.nameName of route`d

Deploy sonatype-nexus with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has sonatype-nexus 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 chartsonatype-nexus is pinned at v1.18.2 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