You must be able to write a Dockerfile, pick the right Pod pattern, and create Deployments, Jobs, and CronJobs with kubectl. The single most important thing: know when an init container is required versus a sidecar, since ordering and completion semantics drive the task.
Start practicing
Application Design and Build — choose a session length
Free · No account required
Domain overview
This domain covers building and running containerized workloads on Kubernetes: writing Dockerfiles, choosing Pod patterns, and creating Deployments, Jobs, and CronJobs with kubectl. CKAD tests it through hands-on tasks where you generate manifests, wire multi-container Pods, and verify running objects in a live cluster.
Exam objectives
Writing Dockerfiles with FROM, RUN, COPY, and CMD to build application images
Choosing multi-container Pod patterns: sidecar, init, adapter, and ambassador containers
Creating Deployments with kubectl create deployment and scaling via --replicas
Defining Jobs and CronJobs for run-to-completion and scheduled batch workloads
Using a sidecar when the task requires a run-to-completion init container, so the main app starts before the diagnostic finishes.
Forgetting that all containers in a Pod share the network namespace, causing port conflicts between the app and its sidecar.
Writing a Dockerfile CMD in shell form when exec form is needed, so signals and arguments are not passed to the process.
Click any question to see the full explanation and answer options, or start a focused practice session above.
A team is deploying a microservice that requires initialization of a database schema before the main application starts. The init container must run a script that writes to a shared volume. Which configuration correctly ensures the init container completes before the main container runs?
2A developer needs to expose a deployment named 'web-app' running on port 8080 to external traffic. The cluster is on-premises with no cloud load balancer. Which service type should be used?
3Which TWO statements are true about Kubernetes Secrets?
4Which THREE are valid reasons to use a StatefulSet instead of a Deployment?
5A developer creates a Deployment with 3 replicas that uses a ConfigMap mounted as a volume. After updating the ConfigMap, the developer expects the pods to pick up the new configuration immediately, but the old configuration is still in use. What is the most likely reason?
6You are tasked with deploying a stateless web application on a Kubernetes cluster. The application is containerized and listens on port 8080. You have created a Deployment named 'webapp' with 3 replicas, and a ClusterIP Service named 'webapp-svc' exposing port 80 targeting the application's port 8080. During testing, you notice that some requests to the service return errors while others succeed. You have verified that all Pods are running and ready. The application logs show no errors. What is the most likely cause of the intermittent failures?
7Arrange the steps to create a Kubernetes Deployment with a rolling update strategy.
8Sequence the steps to expose a Kubernetes Service using a NodePort for external access.
9A developer has a Dockerfile that builds a Go application. The final image size is 800MB. Which improvement would MOST reduce the image size?
10What is the primary purpose of an Init Container in a Pod?
11A user runs: kubectl run my-pod --image=nginx --restart=Never --dry-run=client -o yaml. Which apiVersion is used in the generated YAML?
12A CronJob is configured with concurrencyPolicy: Replace and a job execution takes 10 minutes. The schedule is */5 * * * *. Which statement is true about job executions?
13A DevOps engineer wants to deploy a logging sidecar container that reads log files from the main application container. Which volume type should be used to share files between the two containers?
14A Pod has two containers: one with a liveness probe that fails after 30 seconds. The restartPolicy is 'Never'. What state will the Pod be in after the liveness probe fails?
15Which command builds a Docker image from the current directory and tags it as 'myapp:v1'?
16A developer wants to create a Job that runs exactly 3 pods in parallel. Which field should be set in the Job spec?
17In a Dockerfile, what is the difference between CMD and ENTRYPOINT?
18A user runs: kubectl apply -f job.yaml. The Job spec has backoffLimit: 0. The pod fails immediately. What happens?
19An administrator creates a Pod with an ephemeral container using 'kubectl debug my-pod -it --image=busybox --target=my-container'. The ephemeral container shares the same process namespace as the target container. Which flag enables this?
20Which Kubernetes API version is used for creating a CronJob?
21Which TWO statements about Init Containers are correct? (Select exactly 2.)
22A team wants to deploy a multi-container Pod with a sidecar pattern. Which THREE statements are true about sidecar containers? (Select exactly 3.)
23Which Dockerfile instruction is used to specify the base image for a container image?
24A developer is writing a Dockerfile and wants to ensure that the container runs a Python script named 'app.py' as its main process. Which instruction should be used?
25You have a multi-stage Docker build. The first stage compiles a binary, and the second stage copies the binary from the first stage. What is the correct COPY syntax to copy a file named 'app' from the first stage named 'builder'?
26What is the purpose of the '.dockerignore' file?
27A developer wants to tag a local image 'myapp:latest' with the tag 'v1.0.0' for pushing to a registry. Which command does this?
28What is the correct apiVersion for a Kubernetes Job in v1.29?
29A user runs 'kubectl run nginx --image=nginx --restart=Never' and the pod goes into 'Pending' state. What is a likely reason?
30A CronJob is configured with 'concurrencyPolicy: Forbid'. If a job from the previous schedule is still running when the next scheduled time arrives, what happens?
31A user creates a Job with '.spec.completions=5' and '.spec.parallelism=2'. How many pods will run at the same time?
32You need to debug a pod that has no running container because it crashed. The pod is in CrashLoopBackOff. Which command allows you to start a temporary container in the same pod for debugging?
33What is the default restart policy for a pod created with 'kubectl run nginx --image=nginx'?
34Which THREE of the following are valid fields in the '.spec' of a Job manifest?
35A developer wants to containerize a Node.js application. The Dockerfile should first copy only package.json and package-lock.json, run npm install, then copy the rest of the source code. Which Dockerfile best achieves this?
36You need to run a database migration as a container before the main application container starts. Which Kubernetes concept should you use?
37A pod has an init container that fails. The status shows 'Init:CrashLoopBackOff'. The pod's restartPolicy is 'Always'. What happens to the init container?
38A Job must run 10 times in total, with up to 3 pods running simultaneously. Which fields should be set?
39A CronJob is configured with concurrencyPolicy: Forbid and schedule: '*/5 * * * *'. The first job takes 7 minutes. What happens when the next scheduled time arrives?
40You want to expose a container's port 8080 in the Dockerfile. Which instruction should you use?
41Which instruction in a Dockerfile sets the default command to run when the container starts, but allows overriding?
42A multi-stage build has two stages named 'builder' and 'final'. Which instruction copies artifacts from the builder stage to the final stage?
43A pod named 'webapp' is stuck in 'Pending' state. 'kubectl describe pod webapp' shows '0/1 nodes are available: 1 Insufficient memory'. What is the most likely cause?
44Which command attaches an ephemeral container to a running pod for debugging?
45Which TWO practices optimize Docker image size? (Select 2)
46Which THREE statements are true about init containers? (Select 3)
47Which TWO fields are required in a CronJob manifest? (Select 2)
48A pod in the 'production' namespace is in a CrashLoopBackOff state. The pod has been running successfully for several days. You run 'kubectl describe pod app-pod -n production' and see the message: 'OOMKilled'. What is the MOST appropriate action to resolve this issue?
49A Kubernetes Job with parallelism=3 and completions=6 is created. How many pods will run concurrently at most?
50Which field in a CronJob spec specifies the maximum number of successful jobs that should be retained?
51You have a pod with two containers: one runs a web server, and the other is a sidecar that logs the web server's output to a central logging system. Which pattern does this represent?
52You need to debug a pod that has no shell installed. You want to add a temporary container with debugging tools to the pod. Which command should you use?
53What is the purpose of an init container in a pod?
54A CronJob has concurrencyPolicy set to 'Forbid'. At the scheduled time, if the previous job is still running, what happens?
55Which of the following is the correct way to set a memory limit of 512Mi for a container in a pod spec?
56You have a multi-container pod with two containers: container-A and container-B. container-B needs to access the network of container-A. Which configuration is required?
57Which of the following Dockerfile instructions is used to set a command that runs when the container starts and can be overridden by command-line arguments?
58Which TWO of the following are valid fields in a Job spec? (Select TWO.)
59Which THREE of the following are correct about init containers? (Select THREE.)
60Which of the following are valid concurrencyPolicy values for a CronJob? (Select all that apply.)
61Which Dockerfile instruction is used to specify the base image for a build?
62You run the following command: 'kubectl run nginx --image=nginx --restart=Never'. What Kubernetes resource is created?
63You have a multi-stage Dockerfile with two stages: 'builder' and 'runtime'. You want to copy artifacts from the builder stage to the runtime stage. Which Dockerfile instruction achieves this?
64A pod has two containers: a web server and a sidecar that scrapes logs. The sidecar container needs to read log files written by the web server. How should the logs be shared between the containers?
65You need to run a one-time batch job that processes 10 work items in parallel, with a maximum of 3 pods running at the same time. Which Job YAML fields should you set?
66You have a CronJob that runs every 5 minutes. The job sometimes takes longer than 5 minutes to complete. You want to ensure that while a job is running, the next scheduled job is skipped (not started). Which concurrencyPolicy should you use?
67Which of the following best describes the purpose of an init container?
68You want to create a Deployment that runs 5 replicas of a web application. Which kubectl command should you use?
69You have a Job that should retry up to 3 times if it fails, and should be considered failed after 4 failures total (including retries). Which YAML fields should you set?
70Which of the following is true about the CMD instruction in a Dockerfile?
71You want to debug a running pod by starting a temporary container that has network access to the pod's containers. Which kubectl command should you use?
72Which Dockerfile instruction is used to define a mount point for a volume?
73Which THREE of the following are valid fields in a CronJob specification?
74Which TWO of the following are true about .dockerignore files?
75Which of the following is the correct way to create a simple Pod named 'nginx' running the nginx:1.25 image using kubectl?
76You have a Pod that runs a web server and you want to add a sidecar container that exposes a Prometheus metrics endpoint by scraping the web server's logs. Which sidecar pattern does this exemplify?
77A developer creates a Dockerfile with the following content: FROM alpine:3.18 COPY app.sh /app.sh RUN chmod +x /app.sh CMD ["/app.sh"] They want to override the command to run '/app.sh --debug' when deploying the container in Kubernetes. Which of the following pod spec fields should they use?
78You need to run a batch job that processes 100 items. The job should be considered complete when all items are processed successfully. You want to run up to 10 pods concurrently. Which job configuration is correct?
79You have a CronJob that runs every 5 minutes. The previous job is still running when the next scheduled time arrives. You want the new job to be skipped if the previous one is still running. Which concurrencyPolicy should you set?
80Which of the following is NOT a valid restart policy for a Pod?
81You have a multi-stage Dockerfile. You want to copy artifacts from the builder stage to the final stage. Which instruction should you use in the final stage?
82You need to debug a running pod that does not have a shell installed. Which kubectl command allows you to start an ephemeral container with a shell?
83A Job has the following spec: apiVersion: batch/v1 kind: Job metadata: name: pi spec: template: spec: containers: - name: pi image: perl command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] restartPolicy: Never backoffLimit: 4 If the pod fails, how many times will Kubernetes retry the job before considering it failed?
84Which file prevents certain files from being copied into a Docker image during a build?
85You have a Pod with two containers: a main application and a sidecar that handles logging. The sidecar needs access to the same log files as the main application. Which volume type allows both containers to share files?
86You run 'kubectl apply -f pod.yaml' but the pod remains in 'Pending' state. 'kubectl describe pod' shows '0/1 nodes are available: 1 Insufficient cpu'. What is the most likely cause?
87Which TWO of the following are valid ways to expose a container port in a pod spec?
88You are tasked with containerizing a Go application. The application compiles into a binary. Which Dockerfile best implements a multi-stage build to produce a minimal image?
89You run 'kubectl run nginx --image=nginx --restart=Never --dry-run=client -o yaml'. What is the output?
90Which Dockerfile instruction sets a default command that can be overridden by arguments passed to 'docker run'?
91A Job must run exactly 3 Pods in parallel. Which Job manifest field achieves this?
92A CronJob must run a task every day at midnight, but if the previous job is still running, the new job should be skipped. Which concurrencyPolicy should be set?
93What is the correct schedule expression for a CronJob that runs every 5 minutes?
94Which 'kubectl' command creates a pod named 'test-pod' using the nginx image and outputs the YAML manifest without actually creating it?
95A Pod with an init container and a main container is created. The init container runs a script that takes 10 seconds. The main container's startupProbe has initialDelaySeconds: 5. When does the startupProbe begin?
96You have a Dockerfile with 'CMD ["nginx", "-g", "daemon off;"]'. A developer wants to run the container with a different command: 'nginx -t'. How should they run the container?
97Which TWO statements about init containers are true? (Select 2)
98Which TWO instructions are commonly used to add files to a Docker image during build? (Select 2)
99You 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'?
100You have a Dockerfile with a multi-stage build. The first stage is named 'builder' and uses 'golang:1.20' to compile a binary. The second stage uses 'alpine:3.18' and should copy the binary from the first stage. Which COPY instruction is correct?
101You are designing a Pod that must run a diagnostic tool to collect network logs before the main application starts. The diagnostic tool should run to completion, then the main application starts. Which approach should you use?
102Which YAML snippet correctly defines a CronJob that runs a task every 5 minutes?
103You have a CronJob that runs a backup every hour. Due to a network issue, some backups take longer than an hour, causing overlapping executions. You want to ensure that if a new job is scheduled while the previous one is still running, the new job is skipped. Which concurrencyPolicy should you set?
104A developer wants to debug a running container in a Pod named 'web-app' in namespace 'dev'. Which command attaches an ephemeral container with the 'nicolaka/netshoot' image for network debugging?
105What is the purpose of a .dockerignore file in a Docker build context?
106You are deploying a Pod that contains two containers: a web server and a file sync agent. The file sync agent needs to run as long as the web server is running and should share the same network namespace. Which design pattern does this represent?
107You need to run a batch job that processes 10 items in parallel across 10 Pods, but the job should be considered complete only when all 10 Pods have succeeded. Which Job configuration is correct?
108You are writing a Dockerfile and want to ensure that the CMD instruction is overridable when running the container, but the ENTRYPOINT should not be easily overridden. Which combination should you use?
109Which TWO options are valid ways to tag an image when building with Docker?
110Which THREE are valid patterns for multi-container Pods?
111Which Dockerfile instruction sets a command that can be overridden when running the container?
112A developer runs 'kubectl run mypod --image=nginx --restart=Never' and the pod is created. However, when the container exits, the pod terminates. Which restart policy ensures the pod does NOT restart after completion?
113You need to run a batch job that processes a queue and must ensure exactly 5 pods run successfully in parallel. Which Job configuration field should be set?
114A CronJob is configured with 'concurrencyPolicy: Forbid'. What happens if the scheduled time arrives while the previous job is still running?
115Consider the following partial Dockerfile: FROM alpine:3.18 AS builder RUN apk add --no-cache curl COPY src /app/src RUN make /app/bin FROM alpine:3.18 COPY --from=builder /app/bin /app/bin CMD ["/app/bin"] What is the primary benefit of this multi-stage build?
116A pod named 'app' has a container that logs to stdout. You want to add a sidecar container that streams these logs to a centralized logging service. Which pattern does this represent?
117A pod with an init container and a main container has 'restartPolicy: Always'. The init container exits with code 0. What happens next?
118Which of the following is a valid schedule for a CronJob that runs every day at midnight?
119You run 'kubectl run debug-pod --image=busybox -it --restart=Never -- sh' but the pod starts and immediately exits. You want to keep the container running to execute commands later. What flag should you add?
120Which TWO statements about the .dockerignore file are true?
121Which THREE of the following are valid patterns for multi-container pods?
122Which of the following Dockerfile instructions sets the working directory for any subsequent RUN, CMD, ENTRYPOINT, COPY, and ADD instructions?
123You have a multi-stage Dockerfile. The first stage builds a binary using a large build image. The second stage copies the binary from the first stage into a minimal runtime image. Which Dockerfile instruction is used to copy artifacts from a previous stage?
124You are tasked with running a batch job that processes 100 items in parallel, using a Kubernetes Job. The Job should ensure that all items are processed even if some pods fail, and the total number of pod failures should be limited to 3. Which Job configuration is correct?
125You need to schedule a task that runs every day at 2:00 AM. The task should be allowed to run even if a previous instance is still running. Which concurrencyPolicy should you set in the CronJob spec?
126Which of the following commands creates a deployment named 'webapp' that runs the image 'nginx:1.25' with 3 replicas?
127You have a multi-container pod with a main container and a sidecar container that collects logs. The sidecar container should start before the main container and must complete initialization tasks before the main container starts. Which type of container should you use for this purpose?
128You have a pod that runs a single container with the following resource limits: memory: 256Mi, cpu: 500m. The container is consistently using 300Mi of memory and 300m of CPU. The pod is running but you want to avoid OOMKilled. Which change should you make?
129Which of the following is the correct apiVersion for a Kubernetes Job in v1.29?
130You have a Job that runs a batch process. The Job YAML is as follows: apiVersion: batch/v1 kind: Job metadata: name: batch-job spec: parallelism: 4 completions: 12 backoffLimit: 2 template: spec: containers: - name: worker image: myapp:latest restartPolicy: Never If one pod fails after 3 successful completions, and the Job has already completed 7 successes, how many pods will be running at that point? Assume no other failures.
131Which TWO statements about init containers are true?
132Which TWO commands can be used to create a resource from a YAML file?
133Which THREE statements about Dockerfile CMD and ENTRYPOINT are correct?
134You are tasked with building a container image for a Node.js application. The Dockerfile must first install system dependencies, then copy application code, and finally run the app. Which of the following Dockerfiles is correct?
135Which of the following is the correct apiVersion for a CronJob in Kubernetes v1.29?
136A pod is stuck in 'Pending' state. You run 'kubectl describe pod mypod' and see the event: '0/4 nodes are available: 4 Insufficient memory'. Which action will resolve the issue?
137You need to debug a pod that is running but not serving traffic. You want to add a temporary container with networking tools to the pod. Which command should you use?
138An init container in a pod runs a database migration script. The init container fails and exits with a non-zero exit code. What will happen to the pod?
139You have a Dockerfile that uses a multi-stage build. Which of the following statements about multi-stage builds is correct?
140A CronJob is configured with concurrencyPolicy: Forbid. The scheduled job takes longer than the interval between schedules to complete. What happens when the next scheduled time arrives while the previous job is still running?
141You need to ensure that a Pod always runs on a node with an SSD. Which node selector mechanism should you use?
142Which TWO of the following are valid uses of init containers? (Select 2)
143Which THREE of the following are correct about the .dockerignore file? (Select 3)
144Which TWO of the following are valid fields in a CronJob spec? (Select 2)
145A developer is building an image for a Node.js application. The Dockerfile currently copies package.json and package-lock.json, runs npm ci, then copies the rest of the source code. They want to ensure that rebuilding the image after only editing application source files does not re-run npm ci. Which statement about Docker layer caching explains why this Dockerfile ordering achieves that goal?
146A team wants a Pod to expose two containers: a web server container listening on port 8080 and a metrics exporter container listening on port 9100. The Pod manifest must give each container its own containerPort so that monitoring tools can discover them. Which YAML snippet correctly declares both container ports in a single Pod?
147A developer is writing a multi-stage Dockerfile for a Go application. The builder stage compiles the binary, and the final stage uses a minimal base image. The developer wants the final image to contain only the compiled binary and CA certificates, and wants to copy the binary from the builder stage. Which Dockerfile instruction correctly copies the compiled binary from the builder stage into the final stage?
148A developer needs to run a one-off task that processes a queue and then exits. The task must run exactly once per invocation, and if the Pod fails, Kubernetes should restart it until it succeeds. The task should not be restarted after it completes successfully. Which Kubernetes resource should the developer create?
149A developer is defining a Pod that uses an init container to prepare a shared volume before the main application container starts. The init container must download configuration files into an emptyDir volume, and the main container must read them. Which TWO statements about this Pod design are correct? (Choose two.)
You must be able to write a Dockerfile, pick the right Pod pattern, and create Deployments, Jobs, and CronJobs with kubectl. The single most important thing: know when an init container is required versus a sidecar, since ordering and completion semantics drive the task.
The Courseiva CKAD question bank contains 149 questions in the Application Design and Build domain, covering the 20% of the exam attributed to this domain in the official CNCF blueprint. Click any question to see the full explanation and answer breakdown.
Start with a 10-question focused session to identify your baseline accuracy in this domain. Read every explanation — even for questions you answer correctly — to understand the reasoning. Once you score consistently above 80%, move to a 20–30 question session to confirm depth before moving to the next domain.
Yes — the session launcher on this page draws questions exclusively from the Application Design and Build domain. Choose 10, 20, 30, or 50 questions for a focused session, or click individual questions to review them one by one.
Save your results, see per-domain analytics, and get readiness scores — free, for every certification.
Sign Up FreeFree forever · Every certification included