nexus-iq-server-ha
by Sonatype
A cluster of Sonatype Nexus IQ Servers to continuously monitor your entire software supply chain
About this chart
Sonatype IQ Server High Availability Helm Chart
This repository is intended to store a helm chart to create a cluster of Sonatype IQ Server nodes.
General Requirements
- A copy of the helm chart
- A Sonatype IQ Server license that supports the High Availability (HA) feature
- kubectl (1.23+) to run commands against a Kubernetes cluster
- helm (3.9.3+ or 4.x) to install or upgrade the helm chart
- A PostgreSQL (10.7 or newer) database or a PostgreSQL-compatible service
- A Kubernetes (1.23+) cluster to run the helm chart on
- A shared file system to share files between all Sonatype IQ Server pods in the cluster
- A load balancer to distribute requests between the Sonatype IQ Server pods
Nice to have
- A storage class for dynamic provisioning
Running
- Start your Kubernetes cluster if needed
- Open a console/terminal
- Switch to the correct context to use your cluster if needed (e.g.
kubectl config use-context my-context) - Add the helm chart repository via
helm repo add sonatype https://sonatype.github.io/helm3-charts/ - Install the helm chart via
helm install --namespace <namespace> <name> --dependency-update <overrides> sonatype/nexus-iq-server-ha --version <version>where<namespace>can be an existing namespace for the helm chart (created prior viakubectl create namespace <namespace>, or to create automatically include the flag--create-namespace)<name>can be any name for the helm chart<overrides>is a set of overrides for values in the helm chart (see below)<version>is the version of the helm chart to use
- Expose the ingress if needed, which uses port
80for http and port443for https by default
Overrides
License (required)
A Sonatype IQ Server license that supports the HA feature must be installed either before the cluster starts or as it is starting to allow multiple pods to start successfully.
The license file can either be passed directly
--set-file iq_server.license=<license file>
where <license file> is the path to your Sonatype IQ Server product license file
or via an existing secret
--set iq_server.licenseSecret=<license secret>
Database (required)
An existing database can be configured as follows
--set iq_server.database.hostname=<database hostname>
--set iq_server.database.port=<database port>
--set iq_server.database.name=<database name>
--set iq_server.database.username=<database username>
the database password can either be passed directly
--set iq_server.database.password=<database password>
or via an existing secret
--set iq_server.database.passwordSecret=<database password secret>
Shared File System (required)
By default, the helm chart will create both a Persistent Volume (PV) using the configured storage and a corresponding Persistent Volume Claim (PVC).
However, there are various configuration options.
- If a PV is created, then it will match the configuration.
- If a PVC is created, then it will only bind to a PV that satisfies the configuration.
Size
The capacity or size can be set via
--set iq_server.persistence.size=<storage size, default "1Gi">
Access Mode(s)
The access mode(s) can be set via
--set iq_server.persistence.accessModes[0]=<access mode, default "ReadWriteMany">
Note that this should correspond to the type of PV being used.
If you have multiple nodes in your Kubernetes cluster, and a Sonatype IQ Server pod is running on 2 or more of
them, then this must be set to ReadWriteMany and you must use a type of PV that supports it.
Storage Class Name
The storage class name can be set via
--set iq_server.persistence.storageClassName=<storage class name, default "">
Type
The type can be configured as follows.
Note a PV can only have one type, so if multiple are configured, then only one will be used. The priority for which type will be selected if multiple are configured is shown below i.e. a type with a lower number in the below list will be chosen above a type with a higher number.
- csi
--set iq_server.persistence.csi.driver=<csi driver name> --set iq_server.persistence.csi.fsType=<filesystem type> --set iq_server.persistence.csi.volumeHandle=<volume handle> --set iq_server.persistence.csi.volumeAttributes=<volume attributes> - nfs
--set iq_server.persistence.nfs.server=<nfs server hostname> --set iq_server.persistence.nfs.path=<nfs server path, default "/">
Existing PV and PVC
If you have an existing PV and PVC you wish to use, then you only need to set the PVC via
--set iq_server.persistence.existingPersistentVolumeClaimName=<existing persistent volume claim name>
Existing PV
If you have an existing PV you wish to use, then you can set the PV via
--set iq_server.persistence.existingPersistentVolumeName=<existing persistent volume name>
However, you may need to configure the PVC that will be created to allow it to bind to the PV using the previously mentioned configuration options.
Load Balancer (required)
An ingress can be enabled with a particular class name to use an existing load balancer as follows
--set ingress.enabled=<true|false, default false>
--set ingress.ingressClassName=<ingress class name, default "nginx">
--set ingress.pathType=<ingress path type, default "Prefix">
--set ingress.hostApplicationPath=<application path, default iq_server.config.server.applicationContextPath>
--set ingress.hostAdminPath=<admin path, default iq_server.config.server.adminContextPath>
--set ingress.hostApplication=<application hostname>
--set ingress.hostAdmin=<admin hostname>
--set ingress.annotations=<ingress annotations>
Note that if you want both the application and admin endpoints to be accessible, then they will need to be set to have either different hostnames via e.g.
--set iq_server.config.server.hostApplication="app.domain"
--set iq_server.config.server.hostAdmin="admin.domain"
or different paths via e.g.
--set iq_server.config.server.applicationContextPath="/"
--set iq_server.config.server.adminContextPath="/admin"
Note that if no hostnames are specified, then any web traffic to the IP address of your ingress controller can be matched without a name based virtual host being required.
TLS
If your ingress class supports specifying TLS options directly based on your ingress controller, then you can specify them as follows.
A TLS certificate and private key can either be passed directly
--set ingress.tls[0].certificate=<tls certificate file>
--set ingress.tls[0].key=<tls private key file>
where <tls certificate file> is the path to your TLS certificate file and <tls private key file> is the path to your
TLS private key file, or via an existing secret
--set ingress.tls[0].secretName=<tls secret name>
The TLS secret must contain keys named tls.cert for the TLS certificate and tls.key for the TLS private key.
Additionally multiple hosts can be specified as follows
--set ingress.tls[0].hosts[0]=<tls hostname>
Alternatively some ingress classes may support specifying TLS options through annotations.
Domain Name System (DNS) Records (optional)
DNS records can be automatically managed using ExternalDNS based on an ingress. This is included in the chart and can be enabled via
--set externalDns.enabled=true
and configured via
--set externalDns.args=<array of arguments>
Sonatype IQ Server Configuration (optional)
The number of pods can be specified as follows
--set iq_server.replicas=<number of pods, default 2>
The initial admin password can either be passed directly
--set iq_server.initialAdminPassword=<initial admin password>
or via an existing secret
--set iq_server.initialAdminPasswordSecret=<initial admin password secret>
If planning to use ssh for git operations, enable the following flag to generate a private/public key pair. You can retrieve the public key from the pod at /.ssh/id_rsa.pub.
--set iq_server.useGitSsh=<true/false>
A config.yml file is required to run. This is generated using the iq_server.config value. Care should be taken if
updating this as many values within it are fine-tuned to allow the helm chart to function.
Outbound HTTP Proxy (optional)
The proxy for outbound connections is normally configured through the UI or the HTTP Proxy Server Configuration REST API once the server is running. To have outbound connections use the proxy from the first start, without a manual step, set it with JVM system properties
--set iq_server.javaOpts="-Djava.util.prefs.userRoot=/sonatype-work/javaprefs -Dhttps.proxyHost=<proxy host> -Dhttps.proxyPort=<proxy port> -Dhttp.proxyHost=<proxy host> -Dhttp.proxyPort=<proxy port> -Dhttp.nonProxyHosts=<hosts to reach directly, separated by |>"
Once the server is running, configure the proxy through the UI or REST API, which takes precedence over the system properties, and remove them.
Logging
Each Sonatype IQ Server pod outputs application logs to stdout via console appenders and to log files on the shared persistent volume. The default log files under the cluster directory are:
<pod-name>-clm-server.log- main server log<pod-name>-request.log- HTTP request log<pod-name>-audit.log- audit events<pod-name>-policy-violation.log- policy violation events<pod-name>-stderr.log- JVM-level errors that bypass the logging framework (normally empty)
Note that JVM stderr is redirected to <pod-name>-stderr.log on the shared PV rather than to the container's stderr
stream. This means kubectl logs and log collectors that read container stdout/stderr will capture application logs
but not JVM-level errors such as OutOfMemoryError or native crashes. To monitor for these, collect
<pod-name>-stderr.log from the shared PV.
By default, each pod writes its log files to /sonatype-work/clm-cluster/log/ with the pod name prefixed to each
filename (e.g., iq-server-deployment-abc123-clm-server.log). ${HOSTNAME} is a Kubernetes-provided environment
variable that resolves to the pod name. This means log files from all HA nodes are accessible on the shared PV, and
the IQ Server support zip can collect logs from every node in the cluster.
Log aggregation is not bundled with this chart. If you require centralized log forwarding, you are responsible for
integrating your preferred log aggregation solution. A validated Fluent Bit example is provided in the examples/ directory.
Most log collectors work out of the box by collecting container stdout output without any chart configuration changes.
To also capture JVM stderr and log files from terminated pods, configure your collector to read from the shared PV's
log/ directory.
To disable file logging and use only console output, override iq_server.config in a values file to remove all
type: file appenders, keeping only the type: console entries. See the default iq_server.config in
values.yaml for the full structure.
Note that disabling file appenders means the support zip will not include log files, and <pod-name>-stderr.log on
the shared PV will be the only file-based log available.
Aggregate log cleanup
A CronJob is included to clean up old log files from the shared PV under the log/ subPath. This handles both
per-pod log files from terminated pods and any legacy aggregate logs from previous Fluentd-bundled versions. By
default, log files older than 50 days are deleted daily at 1 am. This can be customized as follows
--set aggregateLogFileRetention.deleteCron=<Cron schedule expression, default "0 1 * * *">
--set aggregateLogFileRetention.maxLastModifiedDays=<max last modified time in days, default 50>
Note that sett
Deploy nexus-iq-server-ha with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has nexus-iq-server-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 chartnexus-iq-server-ha is pinned at v209.4.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