sonatype-nexus
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:
- google cloud storage is used for backups
- GCE Ingress controller is used for using a pre-allocated static IP in GCE.
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
- Kubernetes 1.8+ with Beta APIs enabled
- PV provisioner support in the underlying infrastructure
- Fulfill Nexus kubernetes requirements
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.
| Parameter | Description | Default |
|---|---|---|
statefulset.enabled | Use statefulset instead of deployment | false |
replicaCount | Number of Nexus service replicas | 1 |
deploymentStrategy | Deployment Strategy | rollingUpdate |
nexus.imageName | Nexus image | quay.io/travelaudience/docker-nexus |
nexus.imageTag | Version of Nexus | 3.15.2 |
nexus.imagePullPolicy | Nexus image pull policy | IfNotPresent |
nexus.env | Nexus environment variables | [{install4jAddVmParams: -Xms1200M -Xmx1200M -XX:MaxDirectMemorySize=2G -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap}] |
nexus.resources | Nexus resource requests and limits | {} |
nexus.dockerPort | Port to access docker | 5003 |
nexus.nexusPort | Internal port for Nexus service | 8081 |
nexus.service.type | Service for Nexus | NodePort |
nexus.service.clusterIp | Specific cluster IP when service type is cluster IP. Use None for headless service | nil |
nexus.securityContext | Security Context (for enabling official image use fsGroup: 2000) | {} |
nexus.labels | Service labels | {} |
nexus.podAnnotations | Pod Annotations | {} |
nexus.livenessProbe.initialDelaySeconds | LivenessProbe initial delay | 30 |
nexus.livenessProbe.periodSeconds | Seconds between polls | 30 |
nexus.livenessProbe.failureThreshold | Number of attempts before failure | 6 |
nexus.livenessProbe.timeoutSeconds | Time in seconds after liveness probe times out | nil |
nexus.livenessProbe.path | Path for LivenessProbe | / |
nexus.readinessProbe.initialDelaySeconds | ReadinessProbe initial delay | 30 |
nexus.readinessProbe.periodSeconds | Seconds between polls | 30 |
nexus.readinessProbe.failureThreshold | Number of attempts before failure | 6 |
nexus.readinessProbe.timeoutSeconds | Time in seconds after readiness probe times out | nil |
nexus.readinessProbe.path | Path for ReadinessProbe | / |
nexus.hostAliases | Aliases for IPs in /etc/hosts | [] |
nexusProxy.enabled | Enable nexus proxy | true |
nexusProxy.svcName | Nexus proxy service name | nil |
nexusProxy.targetPort | Container Port for Nexus proxy | 8080 |
nexusProxy.port | Port for exposing Nexus | 8080 |
nexusProxy.imageName | Proxy image | quay.io/travelaudience/docker-nexus-proxy |
nexusProxy.imageTag | Proxy image version | 2.4.0_8u191 |
nexusProxy.imagePullPolicy | Proxy image pull policy | IfNotPresent |
nexusProxy.resources | Proxy resource requests and limits | {} |
nexusProxy.env.nexusHttpHost | Nexus url to access Nexus | nil |
nexusProxy.env.nexusDockerHost | Containers url to be used with docker | nil |
nexusProxy.env.enforceHttps | Allow only https access or not | false |
nexusProxy.env.cloudIamAuthEnabled | Enable GCP IAM authentication in Nexus proxy | false |
nexusProxyRoute.enabled | Set to true to create route for additional service | false |
nexusProxyRoute.labels | Labels to be added to proxy route | {} |
nexusProxyRoute.annotations | Annotations to be added to proxy route | {} |
nexusProxyRoute.path | Host name of Route e.g jenkins.example.com | nil |
persistence.enabled | Create a volume for storage | true |
persistence.accessMode | ReadWriteOnce or ReadOnly | ReadWriteOnce |
persistence.storageClass | Storage class of Nexus PVC | nil |
persistence.storageSize | Size of Nexus data volume | 8Gi |
persistence.annotations | Persistent Volume annotations | {} |
persistence.existingClaim | Existing persistent volume name | nil |
nexusBackup.enabled | Nexus backup process | false |
nexusBackup.imageName | Nexus backup image | quay.io/travelaudience/docker-nexus-backup |
nexusBackup.imageTag | Nexus backup image version | 1.4.0 |
nexusBackup.imagePullPolicy | Backup image pull policy | IfNotPresent |
nexusBackup.env.targetBucket | Required if nexusBackup is enabled. Google Cloud Storage bucker for backups format gs://BACKUP_BUCKET | nil |
nexusBackup.nexusAdminPassword | Nexus 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 login | admin123 |
nexusBackup.persistence.enabled | Create a volume for backing Nexus configuration | true |
nexusBackup.persistence.accessMode | ReadWriteOnce or ReadOnly | ReadWriteOnce |
nexusBackup.persistence.storageClass | Storage class of Nexus backup PVC | nil |
nexusBackup.persistence.storageSize | Size of Nexus backup data volume | 8Gi |
nexusBackup.persistence.annotations | PV annotations for backup | {} |
nexusBackup.persistence.existingClaim | Existing PV name for backup | nil |
ingress.enabled | Create an ingress for Nexus | true |
ingress.annotations | Annotations to enhance ingress configuration | {} |
ingress.tls.enabled | Enable TLS | true |
ingress.tls.secretName | Name of the secret storing TLS cert, false to use the Ingress' default certificate | nexus-tls |
ingress.path | Path for ingress rules. GCP users should set to /* | / |
tolerations | tolerations list | [] |
config.enabled | Enable configmap | false |
config.mountPath | Path to mount the config | /sonatype-nexus-conf |
config.data | Configmap data | nil |
deployment.annotations | Annotations to enhance deployment configuration | {} |
deployment.initContainers | Init containers to run before main containers | nil |
deployment.postStart.command | Command to run after starting the nexus container | nil |
deployment.additionalContainers | Add additional Container | nil |
deployment.additionalVolumes | Add additional Volumes | nil |
deployment.additionalVolumeMounts | Add additional Volume mounts | nil |
secret.enabled | Enable secret | false |
secret.mountPath | Path to mount the secret | /etc/secret-volume |
secret.readOnly | Secret readonly state | true |
secret.data | Secret data | nil |
service.enabled | Enable additional service | nil |
service.name | Service name | nil |
service.portName | Service port name | nil |
service.labels | Service labels | nil |
service.annotations | Service annotations | nil |
service.targetPort | Service port | nil |
service.port | Port for exposing service | nil |
route.enabled | Set to true to create route for additional service | false |
route.name | Name 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartsonatype-nexus is pinned at v1.18.2 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