NOTE: This operator would be deprecated soon with a new Operator supporting external database. The steps in this Article are Legacy now.
Nexus Repository Manager can be deployed in OpenShift cluster using various methods
1. Using YAML files
2. Using Helm Charts
3. Using Operator.
This article explains installing Nexus instance with pro license using Nexus Operator in OpenShift.
PreRequisites:
- Running OpenShift Platform with access to RedHat Repositories
- Nexus Repository Manager Operator installed.
- Base64 encoded data of Nexus Pro license file named in this example as nx-license.lic.
$ base64 nx-license.lic
cylwwtYx6Fjh7o4k34Ih3KM.....
- Separate Project for Nexus deployment. This example uses project name, nexus
Procedure:
1. Login to OpenShift UI as admin user
2. Select the project (nexus) from drop down menu.
3. Click "Create instance" from Installed Operators --> Nexus Repository Operator.
4. Switch to YAML view and modify below sections
- metadata:name - Preferred name for this deployment.
- secrets section as below.
(Change enabled to true and add data section with base64 encoded license data).
- env section
-- Replace install4jAddVmParams env variable name with INSTALL4J_ADD_VM_PARAMS name and modify the values as below.
env:
- name: INSTALL4J_ADD_VM_PARAMS
value: >-
-Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m
-Dnexus.licenseFile=/etc/secret-volume/nx-license.lic
-Djava.util.prefs.userRoot=/nexus-data/javaprefs
-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
-XX:ActiveProcessorCount=4
We highly recommend to use external database for container environment.
Below arguments can be added for connecting to a postgresql hostname postgresql, database named nexusdb, as user nexus with password nexus123. Modify the same with your local values.
env:
- name: INSTALL4J_ADD_VM_PARAMS
value: >-
-Xms2703m -Xmx2703m
-Dnexus.licenseFile=/etc/secret-volume/nx-license.lic
-Djava.util.prefs.userRoot=/nexus-data/javaprefs
-Dnexus.datastore.enabled=true
-Dnexus.datastore.nexus.jdbcUrl=jdbc:postgresql://postgresql-host:5432/nexusdb
-Dnexus.datastore.nexus.username=nexus
-Dnexus.datastore.nexus.password=nexus123
-XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
-XX:ActiveProcessorCount=4
Note: By default, Nexus is deployed with minimum heap size of 2703MB. For production deployments, please increase the same as per our system requirements documentation. Also in most production environment, sensitive informations like DB passwords are stored in either configmaps, kubernetes secrets, AWS secrets etc. Please use your preferred encryption system to store sensitive informations and refer the same in above lines.
5. Click Create to start deploying the instance.
6. Once all the resources are up and running, Create a Route Object to enable external access for Nexus UI. Select corresponding Service object and application port 8081 and provide a public hostname for URL.
7. Click the location link of the created Route object to open up nexus UI and login with default credentials (admin/admin123)