nexus-repository-manager
About 2 min
nexus-repository-manager
main usage
- a universal binary repository
- but we use it to provide maven package repository service only
conceptions
- none
purpose
- prepare a kind cluster with basic components
- install
nexus-repository-manager
installation
- prepare a kind cluster with basic components
- download and load images to qemu machine(run command at the host of qemu machine)
- run scripts in download.and.load.function.sh to load function
download_and_load
TOPIC_DIRECTORY="nexus.repository.manager.software" BASE_URL="https://resource.geekcity.tech/kubernetes/docker-images/x86_64" download_and_load $TOPIC_DIRECTORY $BASE_URL \ "docker.io_sonatype_nexus3_3.37.3.dim" \ "docker.io_gradle_7.4.0-jdk8.dim"
- run scripts in download.and.load.function.sh to load function
- configure self-signed issuer
self-signed
issuer- prepare self.signed.and.ca.issuer.yaml
kubectl get namespace application > /dev/null 2>&1 || kubectl create namespace application \ && kubectl -n application apply -f self.signed.and.ca.issuer.yaml
- install nexus-repository-manager
- prepare nexus.repository.manager.values.yaml
- change password of admin by
secrets.htpasswd.password
- change password of admin by
- prepare images
- run scripts in load.image.function.sh to load function
load_image
load_image "docker.registry.local:443" \ "docker.io/sonatype/nexus3:3.37.3"
- run scripts in load.image.function.sh to load function
- install by helm
helm install \ --create-namespace --namespace application \ my-nexus-repository-manager \ https://resource.geekcity.tech/kubernetes/charts/https/sonatype.github.io/helm3-charts/nexus-repository-manager-37.3.2.tgz \ --values nexus.repository.manager.values.yaml \ --atomic
- prepare nexus.repository.manager.values.yaml
test
- check connection
curl --insecure --header 'Host: nexus-repository-manager.local' https://localhost
- works as a npm proxy and private registry that can publish packages
commons-math3
not in storage before actionskubectl -n application exec -it deployment/my-nexus-repository-manager -- \ bash -c 'grep -r commons-math3 /nexus-data/blobs || echo not found anything'
- prepare insecure(http) protocol for connection
- prepare insecure.nexus.repository.manager.ingress.yaml
- apply to cluster
kubectl get namespace test > /dev/null 2>&1 || kubectl create namespace test \ && kubectl -n test apply -f insecure.nexus.repository.manager.ingress.yaml
- check connection
curl --insecure --header 'Host: insecure.nexus.repository.manager.local' https://localhost
- configure
maven-central
repository- configure hosts
echo $QEMU_HOST_IP nexus-repository-manager.local >> /etc/hosts
- extract default admin password
kubectl -n application exec -it deployment/my-nexus-repository-manager -- cat /nexus-data/admin.password
- visit
https://nexus-repository-manager.local/
and login withusername=admin
and extracted password - change
admin
's password with random password generatedPASSWORD=($((echo -n $RANDOM | md5sum 2>/dev/null) || (echo -n $RANDOM | md5 2>/dev/null))) \ && echo $PASSWORD
- enable
anonymous access
- visit
https://nexus-repository-manager.local/#admin/repository/repositories:maven-central
and changeProxy
.Remote storage
tohttps://maven.aliyun.com/repository/central
then clickSave
button
- configure hosts
- prepare nexus.repository.manager.test.sh
- prepare build.gradle
- run npm install
docker run --rm \ --add-host insecure.nexus.repository.manager.local:172.17.0.1 \ -e ADMIN_PASSWORD=$PASSWORD \ -v $(pwd)/nexus.repository.manager.test.sh:/app/nexus.repository.manager.test.sh:ro \ -v $(pwd)/build.gradle:/app/build.gradle:ro \ --workdir /app \ -it docker.io/gradle:7.4.0-jdk8 \ bash '/app/nexus.repository.manager.test.sh'
commons-math3
in storage after actionskubectl -n application exec -it deployment/my-nexus-repository-manager -- \ grep -r commons-math3 /nexus-data/blobs
- visit with web browser and check package published
- visit:
https://nexus-repository-manager.local/#browse/browse:maven-releases
- visit:
uninstallation
- uninstall
nexus-repository-manager
helm -n application uninstall my-nexus-repository-manager # NOTE: pvc will be deleted automatically #kubectl -n application delete pvc my-nexus-repository-manager-data