发布时间: 2024-10-23 文章作者: myluzh 分类名称: Kubernetes 朗读文章
apiVersion: apps/v1 kind: Deployment metadata: name: nexus3 namespace: base-ops spec: replicas: 1 selector: matchLabels: workload.user.cattle.io/workloadselector: deployment-base-ops-nexus3 strategy: type: Recreate template: metadata: labels: workload.user.cattle.io/workloadselector: deployment-base-ops-nexus3 spec: containers: - name: nexus3 image: sonatype/nexus3:3.37.3 imagePullPolicy: IfNotPresent ports: - containerPort: 8081 hostPort: 8082 name: 8081tcp80820 protocol: TCP volumeMounts: - mountPath: /nexus-data name: vol1 volumes: - name: vol1 hostPath: path: /data/nexus-data
#进入容器 root@k8s-master:~# kubectl get pod -n base-ops | grep nexus nexus3-69b47c947f-bdggc 1/1 Running 0 63d root@ks8-master:~# kubectl exec -it nexus3-69b47c947f-bdggc -n base-ops -- /bin/sh sh-4.4$ #启动客户端服务 java -jar /opt/sonatype/nexus/lib/support/nexus-orient-console.jar #连接数据库 connect plocal:/nexus-data/db/security admin admin #更新密码为admin123 update user SET password="$shiro1$SHA-512$1024$NE+wqQq/TmjZMvfI7ENh/g==$V4yPw8T64UQ6GfJfxYq2hLsVrBY8D1v+bktfOxGdt4b/9BthpWPNUy/CBk6V9iA0nHpzYzJFWO8v/tZFtES8CA==" UPSERT WHERE id="admin"
标签: k8s java 部署 k8s部署 nexus nexus3
发表评论