apiVersion: batch/v1
kind: Job
metadata:
  name: kismatic-writer
spec:
  completions: 10
  parallelism: 10 # Multiple writers at the same time
  activeDeadlineSeconds: 60 # Wait up to a minute for this job to complete
  template:
    metadata:
      name: kismatic-writer
    spec:
      containers:
      - name: writer
        image: busybox
        command: ["/bin/sh", "-c"]
        args:
          - "echo kismatic-test > /mnt/$(POD_NAME)"
        volumeMounts:
          - name: test-volume
            mountPath: "/mnt"
        env:
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
      volumes:
        - name: test-volume
          persistentVolumeClaim:
            claimName: kismatic-integration-claim
      restartPolicy: Never