apiVersion: batch/v1
kind: Job
metadata:
  labels:
    jobName: serverless-benchmark
  name: serverless-benchmark
spec:
  template:
    metadata:
      labels:
        jobName: serverless-benchmark
      name: serverless-benchmark
    spec:
      shareProcessNamespace: true
      containers:
      - command:
        - bash
        - -c
        - |
          echo "--------------------------------------------------------------------------------"
          echo "Collecting Serverless benchmarks..."
          echo "--------------------------------------------------------------------------------"
          /home/locust/run-benchmarks.sh 
          pkill -f /usr/local/bin/pilot-agent
        env:
        - name: "NAMESPACE"
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: "CONCURRENCY"
          value: "50"
        - name: "DURATION"
          value: "1m"
        - name: "SPAWN_RATE"
          value: "50"
        image: eu.gcr.io/kyma-project/serverless-bench:708f6a87
        imagePullPolicy: Always
        name: serverless-benchmark
        resources: {}
      dnsPolicy: ClusterFirst
      restartPolicy: Never

