Nexus Connector
The Nexus connector is a platform-agnostic connector that you can use to connect to Nexus repositories.
You can use the Nexus Connector to securely perform Maven, NPM, and PyPI operations in CICD pipelines or Kubernetes workloads without credentials.
Additionally, you can centralize the management of Nexus access configurations across namespaces, avoiding the need to repeat Nexus credentials in each namespace.
TOC
OverviewIntegration RequirementsCreating a Nexus ConnectorFields ReferenceCapabilities of Nexus ConnectorAuthenticationUsing Basic AuthenticationCredential Permissions RequiredProxy and Configuration FilesProxy AddressMaven: settings.xml configurationNPM: .npmrc configurationYarn: .yarnrc.yml configurationPyPI Download: pip.conf configurationPyPI Publish: .pypirc configurationUsing Connectors CSI Driverconfiguration.params for NexusFurther ReadingReferencesOverview
This document covers:
- Integration Requirements: Prerequisites for target Nexus repositories
- Creating a Nexus connector
- Advanced Features: Proxy capabilities and configuration files for Maven, NPM, and PyPI
Integration Requirements
Nexus Repository Prerequisites
- The Nexus server must be accessible from the cluster.
- Supported repository types: Maven (hosted/proxy/group), NPM (hosted/proxy/group), PyPI (hosted/proxy/group).
Client Prerequisites
For Maven clients, you must trust the connector proxy server's certificate before executing mvn operations:
The mvn client must also use the wagon transport:
Creating a Nexus Connector
Here's how to create a basic Nexus Connector:
Fields Reference
spec.connectorClassName:
nexus (constant), specifies the ConnectorClass name for Nexus integration.
spec.address:
Target Nexus server address, for example: https://nexus.example.com. This is the root address of the Nexus server, not a specific repository URL.
spec.auth:
Specifies the authentication method for the Nexus server.
spec.auth.name: should bebasicAuthfor Nexus connector.spec.auth.secretRef: specifies the Secret containing authentication information. The secret should be created in the same namespace as the connector. If your Nexus server does not require authentication, you can omit this field.
Optional Metadata fields:
-
cpaas.io/description: Description information for the connector, for example:
Capabilities of Nexus Connector
Authentication
The Nexus connector supports the following authentication types:
basicAuth: Username and password-based authentication, corresponding secret type:kubernetes.io/basic-auth
Using Basic Authentication
If the secret is not correct, the status.conditions field in the connector will show the error message.
For comprehensive status information, see Connector Status Documentation.
Credential Permissions Required
The required permissions depend on how you intend to use the connector:
- Download only: The credential only requires read permissions for the target repository.
- Upload/Deploy: The credential must have both read and write permissions for the target repository.
For security best practices, create credentials with minimal required permissions.
Proxy and Configuration Files
To provide clients with the ability to access Nexus repositories without credentials, the Nexus connector provides a proxy server that automatically injects authentication information.
The Nexus ConnectorClass provides the following configuration files that can be mounted into Pods via the Connectors CSI Driver:
Proxy Address
Upon Connector creation, the system automatically provisions a proxy service for the target Nexus server.
The proxy endpoint is recorded in status.proxy.httpAddress:
Maven: settings.xml configuration
The settings configuration provides a settings.xml file and a ca.cert file mounted via the Connectors CSI Driver.
Example of the generated settings.xml:
Optional parameter: mirrorRepository — the Nexus repository to use as a Maven mirror. When set, the generated settings.xml will include a <mirrors> section pointing to {address}/repository/{mirrorRepository}.
To mount the settings configuration:
NPM: .npmrc configuration
The npmrc configuration provides a .npmrc file for NPM package operations.
Required parameter: registry — the Nexus NPM proxy repository name (e.g., npm-proxy).
Optional parameter: strictSSL — whether to require SSL (default: "true").
Yarn: .yarnrc.yml configuration
The yarnrc configuration provides a .yarnrc.yml file for Yarn package operations.
Required parameter: registry — the Nexus NPM proxy repository name.
Optional parameter: strictSSL — whether to require SSL (default: "true").
PyPI Download: pip.conf configuration
The pipconf configuration provides a pip.conf file for downloading PyPI packages.
Required parameter: repository — the Nexus PyPI proxy repository name (e.g., pypi-proxy).
PyPI Publish: .pypirc configuration
The pypirc configuration provides a .pypirc file for publishing PyPI packages.
Required parameter: deployRepository — the Nexus PyPI hosted repository name (e.g., pypi-hosted).
Using Connectors CSI Driver
CSI volume attribute parameters:
csi.readOnly: Fixed valuetruecsi.driver: Fixed asconnectors-csicsi.volumeAttributes:connector.name: Name of the Nexus Connectorconnector.namespace: Namespace of the Nexus Connector; if not specified, the Pod's namespace is usedconfiguration.names: The configuration to mount (e.g.,settings,npmrc,yarnrc,pipconf,pypirc)configuration.params: JSON string with runtime parameters for each named configuration (see below)
Multiple configurations can be mounted together by separating names with commas:
configuration.params for Nexus
For the format, validation rules, and default-injection behavior of configuration.params, see configuration.params in the Connectors CSI Driver documentation.
The parameters accepted by each Nexus configuration are: