---
apiVersion: batch/v1
kind: Job
metadata:
  name: data-generator-job
  namespace: uc0
  labels:
    environment: production
    app: data-generator-job
spec:
  backoffLimit: 1
  ttlSecondsAfterFinished: 100
  template:
    spec:
      containers:
      - name: data-generator-container
        image: usman476/mqtt-kafka-faust:latest
        command: ["python3"]
        args: ["generator.py", "--value_type", "float", "--start_value", "1.0", "--end_value", "99.99", "--total_values", "1000", "--output_file", "generated_values.csv"]
        imagePullPolicy: "IfNotPresent"
        volumeMounts:
        - mountPath: /data
          name: data-volume
      restartPolicy: Never
      nodeSelector:
        kubernetes.io/hostname: worker-vm-1
      volumes:
      - name: data-volume
        hostPath:
          # directory location on host
          path: /opt/data
          # this field is optional
          type: Directory