OpenShift Nexus: Difference between revisions
Jump to navigation
Jump to search
Line 29: | Line 29: | ||
[[oc expose]] svc nexus3 | [[oc expose]] svc nexus3 | ||
[[oc rollout]] pause dc nexus3 | [[OpenShift_Application_Operations#pause|oc rollout]] pause dc nexus3 | ||
oc patch dc nexus3 --patch='{ "spec": { "strategy": { "type": "Recreate" }}}' | oc patch dc nexus3 --patch='{ "spec": { "strategy": { "type": "Recreate" }}}' | ||
oc set resources dc nexus3 --limits=memory=2Gi --requests=memory=1Gi | oc set resources dc nexus3 --limits=memory=2Gi --requests=memory=1Gi |
Revision as of 01:04, 26 November 2017
External
Internal
Overview
Nexus is a repository and artifact manager used by OpenShift to cache locally build dependencies, and those used by Maven in particular, close to builds. It is recommended to set up one per OpenShift cluster, to speed up Maven builds.
Installation
Method 1
Use the following template: https://github.com/NovaOrdis/playground/blob/master/openshift/auxiliary-tools/nexus.yaml
Copy it locally and then:
oc process -f nexus.yaml | oc create -f -
Method 2
oc new-app sonatype/nexus3:latest
This will set "app=nexus3" label on all objects created for this application (image stream, deployment config and service).
oc expose svc nexus3
oc rollout pause dc nexus3 oc patch dc nexus3 --patch='{ "spec": { "strategy": { "type": "Recreate" }}}' oc set resources dc nexus3 --limits=memory=2Gi --requests=memory=1Gi
echo "apiVersion: v1 kind: PersistentVolumeClaim metadata: name: nexus-pvc spec: accessModes: - ReadWriteOnce resources: requests: storage: 4Gi" | oc create -f - oc set volume dc/nexus3 --add --overwrite --name=nexus3-volume-1 --mount-path=/nexus-data/ --type persistentVolumeClaim --claim-name=nexus-pvc
Verification
Nexus should be available at: https://nexus3-cicd.apps.openshift.novaordis.io
Troubleshooting
- OpenShift Nexus Kept Getting Restarted
- OpenShift Nexus Pod failed to Start During the CI/CD Pipeline Deployment
Interaction with OpenShift
OpenShift image builders check for the environment variable MAVEN_MIRROR_URL, which should point to: