apiVersion: batch/v1
kind: Job
metadata:
  name: loadtool
spec:
  backoffLimit: 8
  template:
    metadata:
      labels:
        app.kubernetes.io/name: loadtool
        app.kubernetes.io/part-of: ethnet
    spec:
      restartPolicy: Never
      volumes:
        - name: config
          projected:
            sources:
              - configMap:
                  name: loadtool-target-nodes-cfg
                  items:
                    # the static-nodes.json in the base is intentionaly empty.
                    - key: static-nodes.json
                      path: static-nodes.json
              - configMap:
                  name: loadtool-cfg
                  items:
                    # the loadtool.json in the base is valid but only targets a
                    # single node.
                    - key: loadtool.json
                      path: loadtool.json
        - name: results
          # XXX: frustratingly the emptyDir can not be read by kubectl cp after
          # the job completes. will need to do something else here.
          emptyDir: {}
      containers:
        - name: loadtool
          image: robinbryce/bbench-loadtool:main
          imagePullPolicy: Always
          command: ["loadtool", "--config", "/config/loadtool.json"]
          volumeMounts:
            - name: config
              mountPath: /config
            - name: results
              mountPath: /results
