apiVersion: apps/v1
kind: Deployment
metadata:
  name: worker-ubuntu16-04
  namespace: buildbarn
  annotations:
    prometheus.io/port: "80"
    prometheus.io/scrape: "true"
spec:
  replicas: 8
  selector:
    matchLabels:
      app: worker
      instance: ubuntu16-04
  template:
    metadata:
      labels:
        app: worker
        instance: ubuntu16-04
    spec:
      containers:
      - args:
        - /config/worker-ubuntu16-04.jsonnet
        image: buildbarn/bb-worker:20200102T102244Z-300a067
        name: worker
        volumeMounts:
        - mountPath: /config/
          name: configs
          readOnly: true
        - mountPath: /worker
          name: worker
        env:
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
      - args:
        - /config/runner-ubuntu16-04.jsonnet
        image: buildbarn/bb-runner-ubuntu16-04:20200102T102244Z-300a067
        name: runner
        volumeMounts:
        - mountPath: /config/
          name: configs
          readOnly: true
        - mountPath: /worker
          name: worker
      initContainers:
      - name: volume-init
        image: busybox:1.30.1
        command:
        - sh
        - -c
        - mkdir -pm 0777 /worker/build && mkdir -pm 0700 /worker/cache && chmod 0777 /worker
        volumeMounts:
        - mountPath: /worker
          name: worker
      volumes:
      - name: configs
        projected:
          sources:
          - configMap:
              name: runner-ubuntu16-04
              items:
              - key: runner-ubuntu16-04.jsonnet
                path: runner-ubuntu16-04.jsonnet
          - configMap:
              name: worker-ubuntu16-04
              items:
              - key: worker-ubuntu16-04.jsonnet
                path: worker-ubuntu16-04.jsonnet
          - configMap:
              name: common
              items:
              - key: common.libsonnet
                path: common.libsonnet
      - emptyDir: {}
        name: worker
