2023-01-13:joxit/docker-registry-ui是registry的web界面工具之一。请问部署在k3s中,yaml如何写?

Posted 福大大架构师每日一题

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2023-01-13:joxit/docker-registry-ui是registry的web界面工具之一。请问部署在k3s中,yaml如何写?相关的知识,希望对你有一定的参考价值。

2023-01-13:joxit/docker-registry-ui是registry的web界面工具之一。请问部署在k3s中,yaml如何写?

答案2023-01-13:

yaml如下:

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: docker-registry-ui
  name: docker-registry-ui
  namespace: droneci
spec:
  replicas: 1
  selector:
    matchLabels:
      app: docker-registry-ui
  template:
    metadata:
      labels:
        app: docker-registry-ui
    spec:
      containers:
        - env:
            - name: "DELETE_IMAGES"
              value: "true"
            - name: "REGISTRY_TITLE"
              value: "Docker registry UI"
            # - name: "REGISTRY_URL"
            #   value: "http://registry:5000"
            - name: nginx_PROXY_PASS_URL
              value: "http://registry:5000"
            - name: PULL_URL
              value: "docker-registry-ui:80"
            - name: SINGLE_REGISTRY
              value: "true"
          image: "joxit/docker-registry-ui:latest"
          imagePullPolicy: IfNotPresent
          name: docker-registry-ui
          securityContext:
            privileged: true
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: docker-registry-ui
  name: docker-registry-ui
  namespace: droneci
spec:
  ports:
    - port: 80
      protocol: TCP
      targetPort: 80
  selector:
    app: docker-registry-ui
  type: NodePort

---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    app: registry
  name: registry
  namespace: droneci
data:
  config.yml: |
    version: 0.1
    log:
      fields:
        service: registry
    storage:
      cache:
        blobdescriptor: inmemory
      filesystem:
        rootdirectory: /var/lib/registry
    http:
      addr: :5000
      headers:
        X-Content-Type-Options: ['*']
        Access-Control-Allow-Origin: ['*']
        Access-Control-Allow-Methods: ['*']
    health:
      storagedriver:
        enabled: true
        interval: 10s
        threshold: 3

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: registry
  namespace: droneci
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
    - host: dockergit.dsy.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: registry
                port:
                  number: 5000
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: registry
  name: registry
  namespace: droneci
spec:
  replicas: 1
  selector:
    matchLabels:
      app: registry
  template:
    metadata:
      labels:
        app: registry
    spec:
      containers:
        - image: "registry"
          imagePullPolicy: IfNotPresent
          name: registry
          volumeMounts:
            - mountPath: /var/lib/registry
              name: volv
            - mountPath: /etc/docker/registry/config.yml
              subPath: config.yml
              name: volv2
      volumes:
        - hostPath:
            path: /root/k8s/droneci/registry/var/lib/registry
            type: DirectoryOrCreate
          name: volv
        - configMap:
            name: registry
          name: volv2
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: registry
  name: registry
  namespace: droneci
spec:
  ports:
    - port: 5000
      nodePort: 50000
      protocol: TCP
      targetPort: 5000
  selector:
    app: registry
  type: NodePort




以上是关于2023-01-13:joxit/docker-registry-ui是registry的web界面工具之一。请问部署在k3s中,yaml如何写?的主要内容,如果未能解决你的问题,请参考以下文章

2023-01-13:joxit/docker-registry-ui是registry的web界面工具之一。请问部署在k3s中,yaml如何写?

学习笔记——Mybatis分页插件

学习笔记——Spring简介;Spring搭建步骤;Spring的特性;Spring中getBean三种方式;Spring中的标签