apiVersion: batch/v1
kind: Job
metadata:
  name: falco-event-generator
spec:
  template:
    spec:
      serviceAccount: falco-event-generator
      containers:
      - name: falco-event-generator
        image: falcosecurity/event-generator:latest
        imagePullPolicy: IfNotPresent
        command: 
          - /bin/event-generator 
          - test
          - --grpc-unix-socket=unix:///var/run/falco/falco.sock
        env:
        - name: FALCO_EVENT_GENERATOR_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        volumeMounts:
        - mountPath: /var/run/falco
          name: unix-socket-dir
      volumes:
      - hostPath:
          path: /var/run/falco 
        name: unix-socket-dir 
      restartPolicy: Never
  backoffLimit: 1