---
apiVersion: v1
kind: Pod
metadata:
  name: release-worker
spec:
  containers:
    - name: release-worker
      image: "{{ images.release }}"
      command: ["/bin/sh"]
      args: ["-c", "buildbot-worker create-worker . ${BUILDMASTER}:${BUILDMASTER_PORT} ${WORKERNAME} ${WORKERPASS} && buildbot-worker start --nodaemon"]
      resources:
        requests:
          cpu: "250m"
          memory: 1Gi
        limits:
          cpu: "1"
          memory: 1Gi
      env:
        - name: DOCKER_HOST
          value: localhost:2375
      volumeMounts:
      - name: worker-workspace
        mountPath: /home/eve/workspace
    - name: dind-daemon
      image: docker:18.06.1-dind
      resources:
        requests:
          cpu: "500m"
          memory: 1Gi
        limits:
          cpu: "1"
          memory: 1Gi
      securityContext:
        privileged: true
      volumeMounts:
      - name: docker-storage
        mountPath: /var/lib/docker
      - name: worker-workspace
        mountPath: /home/eve/workspace
  volumes:
  - name: docker-storage
    emptyDir: {}
  - name: worker-workspace
    emptyDir: {}
