CertKeen

Certified Kubernetes Application Developer (CKAD) · Free practice question 4 of 12

Indexed Job completion index

A rendering Job at Mevagissey Films must split work into 8 shards, where each Pod knows which shard number (0-7) it owns without any external queue. Which Job configuration provides this?

  1. A.completions: 8 with podFailurePolicy, reading the restart count
  2. B.completionMode: Indexed with completions: 8, reading the JOB_COMPLETION_INDEX environment variable
  3. C.A CronJob with 8 schedules, one for each shard number
  4. D.completionMode: NonIndexed with parallelism: 8, reading the HOSTNAME suffix
Show answer and explanation

Correct answer: B. completionMode: Indexed with completions: 8, reading the JOB_COMPLETION_INDEX environment variable

Why: In an Indexed Job, each Pod gets a completion index from 0 to completions-1, exposed in the JOB_COMPLETION_INDEX environment variable and an annotation. NonIndexed Pods have random name suffixes, so no stable shard number. podFailurePolicy controls failure handling, and eight CronJob schedules would be a clumsy workaround that runs at different times.

More free Certified Kubernetes Application Developer (CKAD) questions