Courseiva
Application Design and BuildeasyMultiple ChoiceObjective-mapped

CKAD Application Design and Build Practice Question

You need to create a Job that runs a single task to completion. Which kubectl command correctly creates a Job named 'data-processor' that runs the image 'myapp/processor:1.0'?

⚠ Common exam trap

Test-takers frequently confuse `kubectl run` with `--restart=Never` as a valid way to create a Job, but it only creates a Pod, missing the Job controller's automatic retry and completion tracking.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

kubectl create job data-processor --image=myapp/processor:1.0

`kubectl create job` is the dedicated command to create a Job resource, which runs a pod to completion without restarting the container after success. The Job controller ensures the pod runs exactly once, making it ideal for batch processing tasks.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • kubectl create deployment data-processor --image=myapp/processor:1.0

    Why it's wrong here

    kubectl create deployment creates a Deployment, a controller intended for long-running, stateless services that need to maintain a desired replica count and support rolling updates and rollbacks. These features are irrelevant to a one-off task that should execute and exit successfully; a Deployment would keep the Pod alive or restart it, preventing completion. A Job is the correct workload for batch processing because it tracks Pod completion and runs to termination.

  • kubectl create job data-processor --image=myapp/processor:1.0

    Why this is correct

    kubectl create job data-processor --image=myapp/processor:1.0 explicitly creates a Job resource, which is the designated controller for finite tasks that must run to completion. The Job controller will create a Pod from the specified image and monitor it; with default settings, it runs a single Pod and marks the Job as complete when that Pod exits with code 0. It also provides automatic retries on failure up to the backoffLimit, making it the correct imperative command for a one-time batch task.

  • kubectl run data-processor --image=myapp/processor:1.0 --restart=Never

    Why it's wrong here

    kubectl run with --restart=Never creates a standalone Pod, not a Job. Although this Pod runs a single command and then terminates, it is not managed by a controller: there are no automatic retries, no backoff policy, no replacement if the Pod is evicted or the node fails, and no durable record of completion. This is a lower-level operation that leaves the task unsupervized, unlike a Job which re-creates failed Pods within configured limits.

  • kubectl create cronjob data-processor --image=myapp/processor:1.0

    Why it's wrong here

    kubectl create cronjob creates a CronJob, which is a controller for scheduling Jobs on a recurring interval defined by cron syntax. It would generate a new Job every time the schedule fires, not a single immediate run, and it would keep generating them indefinitely. For a one-time task that must execute once now and complete, a plain Job is the correct resource, not a CronJob.

About these practice questions

One of 160 original CKAD practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CKAD practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKAD exam.