Nexus Instance Deployment
This document describes the subscription of Nexus Operator and the functionality for deploying Nexus instances.
Nexus does not support deployment in namespaces with SPA (Security Policy Admission) policy set to Restricted due to the following reasons:
- Init Container Requires Root Privileges: Nexus uses init containers to initialize PVC directory permissions, which requires root privileges that are not allowed under the Restricted policy.
Recommendation: Create a dedicated namespace for the Nexus deployment and ensure that its security policy is not set to Restricted. When deploying Nexus with hostPath storage, the namespace security policy must be configured as Privileged.
TOC
Prerequisites
- This document applies to Nexus 3.76 and above versions provided by the platform. It is decoupled from the platform based on technologies such as Operator.
- Please ensure that Nexus Operator has been deployed (subscribed) in the target cluster, meaning the Nexus Operator is ready to create instances.
Deployment Planning
Nexus supports various resource configurations to accommodate different customer scenarios. In different scenarios, the required resources and configurations may vary significantly. Therefore, this section describes what aspects need to be considered in deployment planning before deploying Nexus instances, and what the impact of decision points is, to help users make subsequent specific instance deployments based on this information.
Basic Information
- The Nexus Operator provided by the platform is based on the community's official Nexus Chart, with enhanced enterprise capabilities such as security vulnerability fixes. It is fully compatible with the community version in terms of functionality, and in terms of user experience, it enhances the convenience of Nexus deployment through optional, customizable templates and other methods.
Instance Deployment
Deploying from the Quick Start Template
This template is used to quickly create a lightweight Nexus instance, suitable for development and testing scenarios, not recommended for production environments.
- Compute resources: 2 CPU cores, 4 Gi memory
- Storage: Use node local storage, configure the storage node IP and path
- Network access: Use NodePort to access the service, share the node IP with storage, and specify the port
Complete the deployment by filling in the relevant information according to the template prompts.
Deploying from the Production Template Template
This template is used to quickly create a Production Nexus instance, suitable for production scenarios, recommended for production environments.
- Compute resources: 4 CPU cores, 8 Gi memory
- Storage: Use PVC storage, configure the storage class
- Network access: Use Domain to access the service.
Complete the deployment by filling in the relevant information according to the template prompts.
Deploying from YAML
Resource Configuration
Nexus is deployed using StatefulSet, containing 4 containers: 1 business container and 3 logging containers. When configuring resources, focus on the resources used by the business container, while the logging containers can be deployed with default configurations.
For more information, refer to Resource description in SonarQube Chart
Network Configuration
Network configurations are categorized into two types:
- Network configuration based on ingress
- Network configuration based on NodePort
Network configuration based on ingress supports both https and http protocols. An ingress controller needs to be deployed in the cluster in advance.
Network configuration based on NodePort:
Storage Configuration
Storage configurations are mainly divided into three categories:
- Storage configuration based on StorageClass
- Storage configuration based on PVC
- Storage configuration based on HostPath
Storage configuration based on StorageClass:
Storage configuration based on PVC:
Storage configuration based on HostPath:
Admin Account Configuration
Write the prepared admin password into a secret. The default login username is admin.
Create a Secret, select the Opaque type, and add a password field in the configuration items:
Specify it to Nexus through YAML:
Complete YAML Example
NodePort, HostPath, Admin account