apiVersion: v1
kind: Pod
metadata:
  labels:
    app: dind
  name: dind
spec:
  containers:
    - image: docker:19.03-dind
      name: dind
      args:
        - "--mtu=1440"
      env:
        - name: DOCKER_TLS_CERTDIR #Disable TLS as traffic is not going outside of network.
          value: ""
      volumeMounts:
        - name: docker-dind-data-vol
          mountPath: /var/lib/docker/
        - name: registry-tls-certificate
          mountPath: "/etc/docker/certs.d/registry.ci.svc.cluster.local/"
        - name: dind-tls-certificate-ca
          mountPath: "/cert/ca/"
        - name: dind-tls-certificate-server
          mountPath: "/cert/server/"
      ports:
        - name: daemon-port
          containerPort: 2375
          protocol: TCP
      securityContext:
        privileged: true
  volumes:
  - name: docker-dind-data-vol
    emptyDir: {}
  - name: registry-tls-certificate
    secret:
      secretName: registry-tls-certificate
      items:
        - key: ca.crt
          path: ca.crt
        - key: tls.crt
          path: client.cert
        - key: tls.key
          path: client.key
  - name: dind-tls-certificate-ca
    secret:
      secretName: dind-tls-certificate
      items:
        - key: ca.crt
          path: ca.pem
  - name: dind-tls-certificate-server
    secret:
      secretName: dind-tls-certificate
      items:
        - key: tls.crt
          path: cert.pem
        - key: tls.key
          path: key.pem
