K8S Sonatype/Nexus安装(jar包管理Maven私有仓库)

参考:在 k8s 中安装并使用 nexus

helm 包管理地址:https://artifacthub.io/

Get Sonatype/Nexus

helm repo add sonatype https://sonatype.github.io/helm3-charts/
helm repo update
helm search repo nexus
helm pull sonatype/nexus-repository-manager

准备镜像

docker pull sonatype/nexus3:3.61.0
docker images
docker tag sonatype/nexus3:3.61.0 yourharborAddress/sonatype/nexus3:3.61.0
docker push yourharborAddress/sonatype/nexus3:3.61.0

默认发到外网指定端口

修改values.yaml及模板

image:
storageClass: "nfs-sc" # your nfs
type: NodePort
nodePort: 30123 # 模板里没有这个配置,需要修改模板

vi templates/service.yaml
在service中ports部分添加一行
nodePort: {{ .Values.service.nodePort }}

安装

helm install ngboss-nexus /root/sonatype/nexus-repository-manager -n nexus --debug

查看admin的密码

kubectl get pod --namespace nexus
kubectl cp --namespace nexus  ngboss-nexus-nexus-repository-manager-xxxxxxxxxx-xxxx:/nexus-data/admin.password /root/nexus/apw
cat /root/nexus/apw

查看日志

kubectl logs -f --namespace nexus  ngboss-nexus-nexus-repository-manager-xxxxxxxxxx-xxxxx

处理outreach异常

默认是在访问外网,所以异常
参考:Maven 私服 Nexus 总是弹出错误框?禁用 Outreach 服务吧
1、以管理员身份登陆 Nexus  
2、打开 Administration ->  Capabilities 。 
3、右击, Outreach Management 功能,点击 disable 。

jar所在的路径位置

/opt/sonatype-work/nexus3/blobs/default/content/

参考:Nexus的jar包存储路径

保存在本地的最终是一个 .bytes 类型的文件。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值