#基础镜像FROM sonatype/nexus3EXPOSE 8081
deploy.yaml#命名空间apiVersion: v1kind: Namespacemetadata: name: fandai---apiVersion: apps/v1kind: Deploymentmetadata: name: nexus namespace: fandaispec: replicas: 1 selector: matchLabels: app: nexus template: metadata: labels: app: nexus spec: containers: - name: nexus image: sonatype/nexus3 volumeMounts: - name: nexus mountPath: /nexus-data volumes: - name: nexus nfs: service: fandai-nfs path: /home/nfs/nexus/nexus-data---apiVersion: v1 # 资源版本kind: Service # 资源类型metadata: # 元数据 name: nexus # 资源名称 namespace: fandai # 命名空间spec: # 描述 selector: # 标签选择器,用于确定当前service代理哪些pod app: nexus type: NodePort # service类型 ports: # 端口信息 - protocol: TCP name: nexus port: 8081 # service端口 targetPort: 8081 # pod端口
kubectl apply -f deploy.yaml
初始化配置登录账号是admin,登录密码在挂载目录里
配置阿里云maven仓库
http://maven.aliyun.com/nexus/content/groups/public/
勾选开启所有人访问权限
配置发布版本仓库访问权限和部署权限
配置nexus域名配置测试版本仓库访问权限和部署权限