apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: image-cloner
  name: image-cloner
spec:
  replicas: 1
  selector:
    matchLabels:
      app: image-cloner
  strategy: {}
  template:
    metadata:
      labels:
        app: image-cloner
    spec:
      containers:
      - name: image-cloner
        image: image-cloner:v1
        command: ["/image-cloner"]
        args:
          - "--tls-cert-file=/tls/tls.crt"
          - "--tls-private-key-file=/tls/tls.key"
        ports:
        - containerPort: 443
        env:
        - name: REGISTRY
          value: ""
        volumeMounts:
        - name: tls
          mountPath: "/tls"
          readOnly: true
        - name: auth
          mountPath: "/auth"
          readOnly: true
        - name: docker-sock
          readOnly: false
          mountPath: /var/run/docker.sock
        securityContext:
          privileged: true
          runAsUser: 0
      volumes:
        - name: tls
          secret:
            secretName: image-cloner-tls
        - name: auth
          secret:
            secretName: registry-auth
        - name: docker-sock
          hostPath:
            path: "/var/run/docker.sock"
            type: Socket

