apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: add-inventory
  labels:
    app: add-inventory
    app-group: microservices-orders
spec:
  schedule: "*/5 * * * *"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            app: add-inventory
            app-group: microservices-orders
        spec:
          volumes:
          - name: shared-client-config-volume
            configMap:
              name: cc.shared-client-config
          - name: sasl-jaas-config-volume
            secret:
              secretName: cc.sasl-jaas-config.microservices-orders-client.kafka-devops.microservices-orders
          - name: bootstrap-config-volume
            secret:
              secretName: cc.bootstrap-servers.kafka-devops.microservices-orders
          - name: schema-registry-basic-user-info-config-volume
            secret:
              secretName: cc.schema-registry-basic-auth-user-info.kafka-devops-sr-client.kafka-devops
          - name: schema-registry-url-volume
            secret:
              secretName: cc.schema-registry-url.kafka-devops
          restartPolicy: OnFailure
          containers:
          - name: add-inventory-runner
            image: cnfldemos/add-inventory:sha-93c0516
            volumeMounts:
            - name: shared-client-config-volume
              mountPath: /etc/config/add-inventory/shared-client.properties
              subPath: shared-client.properties
              readOnly: true
            - name: sasl-jaas-config-volume
              mountPath: /etc/config/add-inventory/sasl-jaas-config.properties
              subPath: sasl-jaas-config.properties
              readOnly: true
            - name: bootstrap-config-volume
              mountPath: /etc/config/add-inventory/bootstrap-servers.properties
              subPath: bootstrap-servers.properties
              readOnly: true
            - name: schema-registry-basic-user-info-config-volume
              mountPath: /etc/config/add-inventory/schema-registry-basic-auth-user-info.properties
              subPath: schema-registry-basic-auth-user-info.properties
              readOnly: true
            - name: schema-registry-url-volume
              mountPath: /etc/config/add-inventory/schema-registry-url.properties
              subPath: schema-registry-url.properties
              readOnly: true

