From 17f688f533e0aba1fc86752fa7ef121b90010184 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Sat, 24 Apr 2021 13:45:35 +0000 Subject: [PATCH] Add two new example files --- .../application/job/indexed-job-vol.yaml | 27 ++++++++++++++ .../examples/application/job/indexed-job.yaml | 35 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 content/ja/examples/application/job/indexed-job-vol.yaml create mode 100644 content/ja/examples/application/job/indexed-job.yaml diff --git a/content/ja/examples/application/job/indexed-job-vol.yaml b/content/ja/examples/application/job/indexed-job-vol.yaml new file mode 100644 index 0000000000..ed40e1cc44 --- /dev/null +++ b/content/ja/examples/application/job/indexed-job-vol.yaml @@ -0,0 +1,27 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: 'indexed-job' +spec: + completions: 5 + parallelism: 3 + completionMode: Indexed + template: + spec: + restartPolicy: Never + containers: + - name: 'worker' + image: 'docker.io/library/busybox' + command: + - "rev" + - "/input/data.txt" + volumeMounts: + - mountPath: /input + name: input + volumes: + - name: input + downwardAPI: + items: + - path: "data.txt" + fieldRef: + fieldPath: metadata.annotations['batch.kubernetes.io/job-completion-index'] \ No newline at end of file diff --git a/content/ja/examples/application/job/indexed-job.yaml b/content/ja/examples/application/job/indexed-job.yaml new file mode 100644 index 0000000000..5b80d35264 --- /dev/null +++ b/content/ja/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: {}