- Home
- All questions
- Question 951
CKA study material · question 951 of 1000
A Pod has an application container and a logging sidecar, in that order. kubectl exec is run with no -c. Which container does the command run in?
Show the answer
Answer: A. The application container, being first
Without -c the command runs in the Pod's first container, which is why the flag matters whenever a sidecar is the intended target.
Source: Get a Shell to a Running Container (Kubernetes) — Opening a shell when a Pod has more than one container