Study. uk . com
  1. Home
  2. All questions
  3. 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?

  1. The application container, being first
  2. The sidecar, since sidecars are entered by default
  3. Both, with output interleaved
  4. Neither; the command fails asking for -c
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

Challenge yourself on this topic → Study as cards