apiVersion: batch/v1
kind: Job
metadata:
  name: otus-stresstest
  annotations:
    "helm.sh/hook": post-upgrade
    "helm.sh/hook-delete-policy": hook-succeeded
spec:
  template:
    metadata:
      labels:
        app: otus-stresstest
    spec:
      restartPolicy: Never
      containers:
        - name: otus-stresstest
          image: jordi/ab:latest
          env:
            - name: HOST
              value: "arch.homework"
            - name: IP
              value: "172.20.0.2"
          command:
            - sh
            - "-c"
            - "while sleep 3; do ab -n 50 -c 5 -H \"Host: $HOST\" http://$IP/otusapp/users; done"
            - ">/dev/null &"
  backoffLimit: 0
