50 Free CKAD Practice Questions — Certified Kubernetes Application Developer
Preparing for the CKAD certification? These 50 free practice questions cover all domains of the CKAD exam.
Core Concepts (Questions 1–6)
Question 1
Which command creates a pod named "nginx" running the nginx image?
a) kubectl run nginx --image=nginx
b) kubectl create pod nginx --image=nginx
c) kubectl start nginx --image=nginx
d) kubectl apply nginx --image=nginx
Show Answer
Answer: a) kubectl run nginx --image=nginx
Explanation: kubectl run creates a deployment (or pod with --restart=Never). For CKAD, creating YAML with --dry-run=client -o yaml then editing is the recommended approach.
Question 2
Which command creates a YAML manifest for a deployment without actually creating it?
a) kubectl create deployment web --image=nginx --dry-run=client -o yaml
b) kubectl run web --image=nginx -o yaml
c) kubectl generate deployment web --image=nginx
d) kubectl template deployment web --image=nginx
Show Answer
Answer: a) kubectl create deployment web --image=nginx --dry-run=client -o yaml
Explanation: --dry-run=client prints the YAML without creating resources. -o yaml outputs YAML format. This is the CKAD-recommended approach for efficiency.
Question 3
What does kubectl explain pod.spec.containers do?
a) Lists all pods in a spec
b) Shows documentation for the containers field in pod spec
c) Explains how to create containers
d) Shows running containers
Show Answer
Answer: b) Shows documentation for the containers field in pod spec
Explanation: kubectl explain is an essential CKAD tool — it shows field descriptions, types, and required/optional status for any Kubernetes resource field.
Configuration (Questions 7–16)
Question 4
Which command creates a ConfigMap from literal values?
a) kubectl create configmap my-config --from-literal=key=value
b) kubectl create configmap my-config --from-file=config.txt
c) kubectl create configmap my-config --from-env-file=.env
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: ConfigMaps can be created from literals, files, directories, or env files. Use --from-literal, --from-file, or --from-env-file.
Question 5
How do you securely store a database password in Kubernetes?
a) ConfigMap
b) Secret (base64 encoded)
c) Environment variable in Dockerfile
d) Hard-code in the application
Show Answer
Answer: b) Secret (base64 encoded)
Explanation: Secrets are base64-encoded (not encrypted by default) and should be combined with KMS encryption, RBAC, and external secrets operators for production.
Question 6
Which security context setting ensures a container runs as non-root?
a) runAsUser: 1000
b) runAsNonRoot: true
c) privileged: false
d) readOnlyRootFilesystem: true
summary="Show Answer">
Answer: b) runAsNonRoot: true
Explanation: runAsNonRoot: true prevents the container from running as root. runAsUser sets the user but doesn't prevent root. privileged: false is the default.
Multi-Container Pods (Questions 17–21)
Question 7
Which pattern uses a helper container that runs alongside the main application in the same pod?
a) Ambassador
b) Sidecar
c) Adapter
d) Init container
Show Answer
Answer: b) Sidecar
Explanation: A sidecar container enhances the main container (e.g., log shipper, proxy). It shares the same pod lifecycle, network, and storage.
Question 8
When do init containers run relative to regular containers?
a) In parallel with regular containers
b) After regular containers start
c) Before regular containers, sequentially
d) At any point during the pod lifecycle
Show Answer
Answer: c) Before regular containers, sequentially
Explanation: Init containers run before app containers. Each init container must complete successfully before the next starts. If any fails, Kubernetes restarts the pod.
Observability (Questions 22–29)
Question 9
Which probe checks if a container is healthy and should be restarted?
a) Readiness probe
b) Liveness probe
c) Startup probe
d) Health probe
Show Answer
Answer: b) Liveness probe
Explanation: Liveness probes determine if a container is healthy. If it fails, kubelet restarts the container. Readiness probes control Service traffic.
Question 10
Which command streams logs from a pod continuously?
a) kubectl logs pod-name
b) kubectl logs -f pod-name
c) kubectl logs --stream pod-name
d) kubectl tail pod-name
Show Answer
Answer: b) kubectl logs -f pod-name
Explanation: -f (follow) streams logs in real-time. --tail=N shows the last N lines. Use --since=5m for recent logs.
Pod Design (Questions 30–39)
Question 11
Which rollout strategy terminates existing pods before creating new ones?
a) RollingUpdate
b) Recreate
c) Blue/Green
d) Canary
Show Answer
Answer: b) Recreate
Explanation: Recreate kills all existing pods before creating new ones (causing downtime). RollingUpdate gradually replaces pods.
Question 12
Which command rolls back a deployment to the previous revision?
a) kubectl rollout undo deployment/web
b) kubectl rollback deployment/web
c) kubectl revert deployment/web
d) kubectl deployment undo web
Show Answer
Answer: a) kubectl rollout undo deployment/web
Explanation: rollout undo reverts to the previous revision. --to-revision=N rolls back to a specific revision. Use rollout history to see revisions.
Services & Networking (Questions 40–45)
Question 13
Which Service type exposes a service on a static port on each node?
a) ClusterIP
b) NodePort
c) LoadBalancer
d) Headless
Show Answer
Answer: b) NodePort
Explanation: NodePort exposes the service on a static port (30000-32767) on each node's IP. Traffic to NodeIP:NodePort routes to ClusterIP and then to pods.
Question 14
What is a headless service used for?
a) Load balancing traffic
b) DNS-based service discovery returning pod IPs
c) Exposing services externally
d) Encrypting service traffic
Show Answer
Answer: b) DNS-based service discovery returning pod IPs
Explanation: Headless services (clusterIP: None) return pod IPs directly via DNS, enabling client-side discovery for stateful applications like databases.
State Persistence (Questions 46–50)
Question 15
Which Kubernetes resource requests storage from a cluster?
a) PersistentVolume
b) PersistentVolumeClaim
c) StorageClass
d) Volume
Show Answer
Answer: b) PersistentVolumeClaim
Explanation: A PVC is a request for storage. Kubernetes binds it to a PV that matches the requirements (size, access mode, storage class).
Question 16
Which access mode allows multiple pods on different nodes to read and write?
a) ReadWriteOnce
b) ReadOnlyMany
c) ReadWriteMany
d) ReadWriteOncePod
Show Answer
Answer: c) ReadWriteMany (RWX)
Explanation: RWX allows many nodes to read and write simultaneously. Not all storage providers support RWX (NFS does, EBS doesn't).
How Did You Score?
- 0–25 correct: Review the CKAD Exam Guide.
- 26–40 correct: On track. Practice imperative kubectl commands.
- 41–50 correct: Ready for the exam!
Access all CKAD practice questions →
Related Articles
Bereit, dein Wissen zu testen?
Probiere unsere Übungsprüfungen mit Hunderten von realistischen Fragen aus.
Üben starten →