From 0687a194f45f3f9fa999f3f13585378c6541c34b Mon Sep 17 00:00:00 2001 From: Sabbir Ahmed Shameem <145862004+SAShameem@users.noreply.github.com> Date: Tue, 7 May 2024 22:13:51 +0600 Subject: [PATCH] Create indexed-job.yaml --- .../examples/application/job/indexed-job.yaml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 content/bn/examples/application/job/indexed-job.yaml diff --git a/content/bn/examples/application/job/indexed-job.yaml b/content/bn/examples/application/job/indexed-job.yaml new file mode 100644 index 0000000000..5b80d35264 --- /dev/null +++ b/content/bn/examples/application/job/indexed-job.yaml @@ -0,0 +1,35 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: 'indexed-job' +spec: + completions: 5 + parallelism: 3 + completionMode: Indexed + template: + spec: + restartPolicy: Never + initContainers: + - name: 'input' + image: 'docker.io/library/bash' + command: + - "bash" + - "-c" + - | + items=(foo bar baz qux xyz) + echo ${items[$JOB_COMPLETION_INDEX]} > /input/data.txt + volumeMounts: + - mountPath: /input + name: input + containers: + - name: 'worker' + image: 'docker.io/library/busybox' + command: + - "rev" + - "/input/data.txt" + volumeMounts: + - mountPath: /input + name: input + volumes: + - name: input + emptyDir: {}