---
apiVersion: batch/v1
kind: Job
metadata:
  name: load-testing
  namespace: openshift-update-service
spec:
  parallelism: 1
  completions: 1
  selector: {}
  template:
    metadata:
      name: vegeta
    spec:
      volumes:
        - name: config-volume
          configMap:
            name: vegeta-config
      containers:
        - name: vegeta
          image: quay.io/cloud-bulldozer/vegeta:latest
          command:
            - sh
            - '-c'
            - |
              vegeta \
              attack \
              -insecure \
              -format=http \
              -workers=10 \
              -max-workers=2000 \
              -rate=10000 \
              -duration=300s \
              -targets=/etc/config/vegeta.targets |\
              vegeta \
              report
          volumeMounts:
            - name: config-volume
              mountPath: /etc/config
      restartPolicy: Never
