apiVersion: apps/v1
kind: Deployment
metadata:
  name: registry
  namespace: registry
  labels:
    app: registry
spec:
  replicas: 1
  selector:
    matchLabels:
      app: registry
  template:
    metadata:
      labels:
        app: registry
    spec:
      containers:
      - name: registry
        image: registry:2
        ports:
        - containerPort: 5000
        env:
        - name: REGISTRY_STORAGE_DELETE_ENABLED
          value: "true"
        volumeMounts:
        - name: data
          mountPath: /var/lib/registry
      - name: registry-ui
        image: joxit/docker-registry-ui:2.1.0
        ports:
        - containerPort: 80
        env:
        - name: NGINX_PROXY_PASS_URL
          value: "http://127.0.0.1:5000"
        - name: DELETE_IMAGES
          value: "true"
        - name: SINGLE_REGISTRY
          value: "true"
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: registry-data
