From d6b142070dd6ed0ce4992a36f0f071f8d7012d4b Mon Sep 17 00:00:00 2001 From: Aldo Culquicondor Date: Fri, 16 Jul 2021 15:01:43 -0400 Subject: [PATCH] Add details about using the Job completion index --- content/en/docs/concepts/workloads/controllers/job.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/en/docs/concepts/workloads/controllers/job.md b/content/en/docs/concepts/workloads/controllers/job.md index d2349fea93646..94634e4f47faf 100644 --- a/content/en/docs/concepts/workloads/controllers/job.md +++ b/content/en/docs/concepts/workloads/controllers/job.md @@ -197,7 +197,13 @@ Jobs with _fixed completion count_ - that is, jobs that have non null completion is homologous to each other. Note that Jobs that have null `.spec.completions` are implicitly `NonIndexed`. - `Indexed`: the Pods of a Job get an associated completion index from 0 to - `.spec.completions-1`, available in the annotation `batch.kubernetes.io/job-completion-index`. + `.spec.completions-1`. The index is available through three mechanisms: + - The Pod annotation `batch.kubernetes.io/job-completion-index`. + - As part of the Pod hostname, following the pattern `$(job-name)-$(index)`. + When you use an Indexed Job in combination with a + {{< glossary_tooltip term_id="Service" >}}, Pods within the Job can use + the deterministic hostnames to address each other via DNS. + - From the containarized task, in the environment variable `JOB_COMPLETION_INDEX`. The Job is considered complete when there is one successfully completed Pod for each index. For more information about how to use this mode, see [Indexed Job for Parallel Processing with Static Work Assignment](/docs/tasks/job/indexed-parallel-processing-static/).