Search code examples
kuberneteskubernetes-jobs

Indexed fixed completion count job, more than one pod with the same index


A bit unclear sentence in the doco:

Note that, although rare, more than one Pod could be started for the same index, but only one of them will count towards the completion count.

So say it happens, there are two pods in an Indexed job with the same index. Now, one of them is failed (the restartPolicy = "Never"), another succeed. Assume that all other pods succeed. Will the job fail overall? Or maybe it depends on which one of those sharing the same index was first - the succeeded or the failed one? Or is it totally indeterminate?


Solution

  • The first sentence is important:

    The Job is considered complete when there is one successfully completed Pod for each index.

    There can be duplicated index but for each index, only one (the one that reached Completed first) will be counted for spec.completions.