Certified Kubernetes Application Developer (CKAD) · Free practice question 1 of 12
Generating a Pod manifest skeleton
During a timed task, a developer at Poldark Ceramics wants a starting YAML file for a Pod called `kiln` running nginx:1.29 with label tier=web, written to kiln.yaml without creating anything. Which command produces it?
- A.kubectl run kiln --image=nginx:1.29 --labels=tier=web --dry-run=client -o yaml > kiln.yaml
- B.kubectl run kiln --image=nginx:1.29 --labels=tier=web --dry-run=server > kiln.yaml
- C.kubectl create pod kiln --image=nginx:1.29 --labels=tier=web -o yaml > kiln.yaml
- D.kubectl get pod kiln --image=nginx:1.29 -o yaml --export > kiln.yaml
Show answer and explanation
Correct answer: A. kubectl run kiln --image=nginx:1.29 --labels=tier=web --dry-run=client -o yaml > kiln.yaml
Why: kubectl run creates a Pod, and --dry-run=client -o yaml prints the object it would send without contacting the cluster for creation, which makes a quick skeleton. There is no `kubectl create pod` generator. --dry-run=server without -o yaml prints only a one-line message, and kubectl get reads existing objects (the --export flag was removed long ago).
More free Certified Kubernetes Application Developer (CKAD) questions
- Downward API Pod IP as env
- fsGroup for shared volume ownership
- Indexed Job completion index
- Pulling and unpacking a chart locally
- Kustomize namePrefix and references
- Watching Pod status changes live
- tcpSocket probe for a non-HTTP server
- ExternalName Service for an outside host
- StatefulSet per-Pod DNS name
- Ways to consume a Secret in a container
- Checking quota usage in a namespace