推荐 k8s原生镜像仓库registry好用的UI

Docker 官方提供的 registry 没有web管理页面
无意间发现了一个docker registry 的前端页面服务 docker-registry-frontend 还不错,推荐给大家使用

下载


docker pull konradkleine/docker-registry-frontend:v2

[root@k8s-master01 registry]# docker pull konradkleine/docker-registry-frontend:v2
v2: Pulling from konradkleine/docker-registry-frontend
Digest: sha256:181aad54ee64312a57f8ccba5247c67358de18886d5e2f383b8c4b80a7a5edf6
Status: Image is up to date for konradkleine/docker-registry-frontend:v2
docker.io/konradkleine/docker-registry-frontend:v2
[root@k8s-master01 registry]#

下载下来后,我放到k8s里面部署了

部署


我的deployment.yaml文件

apiVersion: apps/v1
kind: Deployment
metadata:
  name: registry-frontend
  namespace: docker-registry
spec:
  selector:
    matchLabels:
      app: registry-frontend
  replicas: 1
  template:
    metadata:
      labels:
        app: registry-frontend
    spec:
      nodeSelector:
        name: "node-235"
      containers:
      - name: registry-frontend
        image: konradkleine/docker-registry-frontend:v2
        ports:
        - containerPort: 8080
        env:
          - name: ENV_DOCKER_REGISTRY_HOST
            value: "172.25.42.235"
          - name: ENV_DOCKER_REGISTRY_PORT
            value: "5000"

我把它部署到了和registry同一个命名空间了
参数说明:

      - name: ENV_DOCKER_REGISTRY_HOST # 仓库地址
        value: "172.25.42.235"
      - name: ENV_DOCKER_REGISTRY_PORT # 仓库端口
        value: "5000"

启动


[root@k8s-master01 registry]# kubectl apply -f deployment-frontend.yaml 
deployment.apps/registry-frontend created
[root@k8s-master01 registry]# kubectl get pod -n docker-registry
NAME                                READY   STATUS    RESTARTS   AGE
registry-6c58cb656-7lxgz            1/1     Running   1          4h21m
registry-frontend-7f46c6c9c-2fq87   1/1     Running   0          31s

配置上端口,可以在外面访问


我的service.yaml配置内容

apiVersion: v1
kind: Service
metadata:
  namespace: docker-registry
  labels:
    app: registry-frontend
  name: registry-frontend-nodeport
spec:
  externalTrafficPolicy: Cluster
  type: NodePort
  ports:
    - name: manager
      protocol: TCP
      port: 80
      targetPort: 80
      nodePort: 5001
  selector:
    app: registry-frontend

映射宿主机端口5001

应用service配置


[root@k8s-master01 registry]# kubectl apply -f service-frontend.yaml 
service/registry-frontend-nodeport created
[root@k8s-master01 registry]# kubectl get service -n docker-registry
NAME                         TYPE       CLUSTER-IP       EXTERNAL-IP   PORT(S)         AGE
registry-frontend-nodeport   NodePort   10.110.57.28     <none>        80:5001/TCP     10s
registry-nodeport            NodePort   10.103.250.191   <none>        5000:5000/TCP   4h8m
[root@k8s-master01 registry]# 

访问一下

版权声明:本文为作者原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

原创文章,作者:老C,如若转载,请注明出处:https://www.code404.icu/512.html

发表评论

登录后才能评论