---
apiVersion: batch/v1
kind: Job
metadata:
  labels:
    app: sample-consumer-job
  name: sample-consumer-job
spec:
  parallelism: 3
  completions: 3
  backoffLimit: 4
  template:
    metadata:
      labels:
        app: sample-consumer-job
    spec:
      restartPolicy: OnFailure
      activeDeadlineSeconds: 600
      containers:
      - name: sample-consumer
        image: strimzi/hello-world-consumer:latest
        env:
          - name: BOOTSTRAP_SERVERS
            value: demo-kafka-bootstrap:9093
          - name: CA_CRT
            valueFrom:
              secretKeyRef:
                name: demo-cluster-ca-cert
                key: ca.crt
          - name: USER_CRT
            valueFrom:
              secretKeyRef:
                name: user-demo
                key: user.crt
          - name: USER_KEY
            valueFrom:
              secretKeyRef:
                name: user-demo
                key: user.key            
          - name: TOPIC
            value: greetings
          - name: GROUP_ID
            value: my-demo-group
          - name: LOG_LEVEL
            value: "INFO"
          - name: MESSAGE_COUNT
            value: "333"
