标签:har 映射 个人 gem containe 安装文档 pull tcp 方便
完成前期Kubernetes环境部署后,再部署其它容器,如果还是docker load -i 导入真心很不方便了,急需引入私有仓库。而私有仓库也有几个选择,docker官方的registry很简单,但有个最大的问题就是没有UI,镜像的管理也只有通过RESTful API来操作,很不方便(虽然有他人开发的界面,但不太成熟,个人可以自己把握)。VMware的Harbor和SUSE Portus都不错,但Sonatype的Nexus3更加简单,而且还可以做Maven、yum的源。因此,此处我选取Nexus3作为我的私有仓库。nexus3-deployment.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nexus
spec:
selector:
matchLabels:
app: nexus
template:
metadata:
labels:
app: nexus
spec:
containers:
- name: nexus
image: sonatype/nexus3:3.21.1
imagePullPolicy: IfNotPresent
ports:
- name: web # web ui for management
containerPort: 8081 # port of web management
hostPort: 8081 # use hostport directly for access
protocol: TCP
- name: docker-office # the name of internal docker registry
containerPort: 8082 # port of docker registry
hostPort: 8082 # use hostport directly for access
resources:
requests:
cpu: 4000m # default reqirement
volumeMounts:
- name: nexus-data
mountPath: /nexus-data
volumes:
- name: nexus-data
hostPath:
path: /home/nexus-data # use local path for selected host
nodeSelector:
"kubernetes.io/hostname": nf5270m4-repo
tolerations:
- key: "node-role.kubernetes.io/node"
operator: "Exists"
effect: "PreferNoSchedule"
---
apiVersion: v1
kind: Service
metadata:
name: nexus
spec:
selector:
app: nexus
ports:
- name: webadmin
port: 8081
targetPort: 8081
- name: nexus3docker
port: 8082
targetPort: 8082
说明:
Kubernetes集群实践(06)使用Nexus3部署私有仓库
标签:har 映射 个人 gem containe 安装文档 pull tcp 方便
原文地址:https://blog.51cto.com/huanghai/2476865