apiVersion: batch/v1
kind: Job
metadata:
  name: agent-load-generator
  namespace: agent-load-test
spec:
  backoffLimit: 0
  ttlSecondsAfterFinished: 3600
  template:
    metadata:
      labels:
        app: agent-load-generator
    spec:
      restartPolicy: Never
      containers:
        - name: k6
          image: grafana/k6:latest
          args: ["run", "/scripts/loadtest.js"]
          envFrom:
            - secretRef:
                name: agent-backend-runtime
          volumeMounts:
            - name: script
              mountPath: /scripts
      volumes:
        - name: script
          configMap:
            name: k6-load-script
