Courseiva

CKA Practice Question: Cluster Architecture, Installation and Configuration

A developer wants to run a one-time batch job that processes data and then exits. Which Kubernetes resource should be used?

⚠ Common exam trap

Watch out — candidates often confuse a CronJob with a Job, assuming any batch-like task requires scheduling, but the question explicitly says 'one-time,' which eliminates the need for a schedule.

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

Job

A Job is the correct Kubernetes resource for a one-time batch task that runs to completion and then exits. It ensures a specified number of Pods terminate successfully, making it ideal for processing data and exiting without requiring continuous availability.

Answer analysis

Option-by-option breakdown

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

  • DaemonSet

    Why it's wrong here

    A DaemonSet ensures a copy of a pod runs on every node in the cluster, typically for infrastructure services like log collectors or monitoring agents. It is not suited for a one-time batch job because its pods are meant to run continuously or as long as nodes exist, and they are recreated if they terminate. The developer wants a task that completes once, not a per-node long-running process.

  • CronJob

    Why it's wrong here

    CronJobs create Jobs on a recurring schedule defined by a cron expression, suitable for periodic tasks like nightly backups. Since the developer needs a single execution now, a CronJob adds unnecessary scheduling overhead and would either need to be manually triggered once or created and deleted immediately, which is less straightforward than using a plain Job. Additionally, CronJobs by default may create multiple Jobs if a run is missed, which is not desired for a one-time batch.

  • Deployment

    Why it's wrong here

    A Deployment manages a set of identical pods and maintains a desired replica count, automatically restarting or replacing failed pods to keep the application available. It is designed for stateless, long-running services like web servers or API backends, not for a finite batch process that should exit upon completion. If you used a Deployment, the pod would be restarted after it exits, preventing the successful completion state that a Job captures.

  • Job

    Why this is correct

    A Kubernetes Job creates one or more pods and ensures that a specified number of them successfully terminate, tracking the overall completion. It is the ideal controller for a one-time batch task because the pod runs to completion and the Job status becomes Complete, without any automatic restart of the finished pod. If the pod fails, the Job can restart it according to the backoffLimit, ensuring the task eventually succeeds.

About these practice questions

One of 302 original CKA 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 CKA 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 CKA exam.