CKA Workloads & Scheduling Practice Question
A developer wants to deploy a pod that will run only once to initialize a database schema. Which Kubernetes resource should they use?
⚠ Common exam trap
Many exam-takers confuse a Job with a CronJob, thinking they need scheduling, or with a Deployment, assuming all workloads must be continuously running, when the key differentiator is the 'run to completion' lifecycle.
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 task that runs to completion, such as initializing a database schema. Unlike controllers that maintain a desired number of replicas, a Job creates one or more Pods and ensures they successfully terminate, making it ideal for batch or initialization workloads.
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 schedules one pod replica on every node in the cluster (or nodes matching a selector), so it cannot represent a single one-time task. Its purpose is to run long-lived infrastructure components, and it will automatically restart any pod that exits, even if the task succeeded. This makes it unsuitable for a developer wanting exactly one execution to completion.
- ✓
Job
Why this is correct
A Job controller creates one or more pods and tracks them until a specified number successfully terminate. For a one-time task, a simple Job with default completions=1 runs once to completion, and the workload is not recreated if it exits with code 0. It is the native Kubernetes API for exactly-once batch processing.
- ✗
Deployment
Why it's wrong here
A Deployment manages a ReplicaSet and is designed to keep a desired number of identical pods running at all times, with rolling updates and self-healing restarts. If a pod completes and exits successfully, Deployment treats it as unhealthy and schedules a replacement. Therefore it is for stateless, continuously running services, not for a pod that should run only once.
- ✗
CronJob
Why it's wrong here
A CronJob creates Jobs on a recurring schedule defined by cron syntax, so it is inherently repetitive rather than one-off. Even if the schedule is set far in the future, it adds unnecessary scheduling semantics and still expects recurring execution. For an immediate single run, a plain Job avoids the added CronJob controller overhead and schedule configuration.
Go deeper
Related to this question
Learn chapter
Kubernetes Architecture Overview
Key term
Network Policies
A Kubernetes resource that controls how pods communicate with each other and with other network endpoints, acting as a firewall for pod-to-pod traffic.
Key term
Ingress Resources
Ingress Resources are Kubernetes API objects that manage external access to services inside a cluster, typically HTTP and HTTPS traffic, by defining rules for routing requests based on hostnames and paths.
About these practice questions
This CKA question is part of Courseiva's 302-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
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.