Question 32
Domain 1: Application Design and BuildWhich kubectl command creates a container resource but does not start it?
Correct answer: B
Explanation
`kubectl run` with `--restart=Never` creates a Pod rather than a Deployment, and `--dry-run=client -o yaml` only generates the manifest without sending it to the cluster. That means it “creates a container resource but does not start it” because the command outputs YAML instead of actually creating the running object.
Why each option is right or wrong
A. kubectl create deployment myapp --image=nginx --dry-run=client -o yaml
B. kubectl run myapp --image=nginx --restart=Never --dry-run=client -o yaml
Under the `kubectl run` command, `--restart=Never` tells Kubernetes to generate a Pod object rather than a controller-managed workload, and `--dry-run=client` prevents any API call from being sent to the cluster. Adding `-o yaml` prints the manifest to stdout, so no Pod is actually created or started; the command only produces the YAML definition locally.
C. kubectl create pod myapp --image=nginx --save-config
D. kubectl apply -f myapp.yaml --server-side