apiVersion: apps/v1
kind: Deployment
metadata:
  name: docker-mirror
spec:
  selector:
    matchLabels:
      app: docker-mirror
  replicas: 1
  template:
    metadata:
      labels:
        app: docker-mirror
    spec:
      terminationGracePeriodSeconds: 180
      serviceAccountName: "caches"
      nodeSelector:
        type: bare-metal-external
        ci.kubevirt.io/cachenode: "true"
      tolerations:
        - key: "cachenode"
          operator: "Exists"
          effect: "NoSchedule"
      containers:
      - name: mirror
        image: registry:2.7.1
        volumeMounts:
        - name: config
          mountPath: /etc/docker/registry/
          readOnly: true
        - name: storage
          mountPath: /var/lib/registry
        ports:
          - name: http
            containerPort: 5000
        resources:
          requests:
            memory: 3Gi
          limits:
            memory: 3Gi
      volumes:
      - name: config
        configMap:
          name: mirror-config
      - name: storage
        hostPath:
          path: /var/lib/docker-mirror/default
          type: DirectoryOrCreate
