apiVersion: batch/v1
kind: Job
metadata:
  name: sysbench
spec:
  template:
    spec:
      restartPolicy: OnFailure
      containers:
      - name: sysbench
        image: sysbench
        envFrom:
          - configMapRef:
              name: sysbench-options
        command:
          - sysbench
          - --config-file=/etc/sysbench/sysbench.conf
          - --tables=$(TABLES_NUMBER)
          - --table-size=$(TABLE_SIZE)
        volumeMounts:
        - name: config
          mountPath: /etc/sysbench
      volumes:
      - name: config
        configMap:
          name: sysbench-conf
          items:
          - key: sysbench.conf
            path: sysbench.conf
