Bird
0
0

Which of the following best describes the function of the kubectl exec command in Kubernetes?

easy📝 Conceptual Q1 of 15
Kubernetes - kubectl Essential Commands
Which of the following best describes the function of the kubectl exec command in Kubernetes?
AList all pods in the current namespace
BCreate a new pod in the cluster
CDelete a pod from the cluster
DExecute a command directly inside a running container of a pod
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command purpose

    kubectl exec is used to run commands inside containers of running pods.
  2. Step 2: Eliminate other options

    Creating, deleting, or listing pods are done with other kubectl commands like kubectl create, kubectl delete, or kubectl get pods.
  3. Final Answer:

    Execute a command directly inside a running container of a pod -> Option D
  4. Quick Check:

    Command runs inside container [OK]
Quick Trick: kubectl exec runs commands inside containers [OK]
Common Mistakes:
  • Confusing exec with pod creation or deletion commands
  • Assuming exec lists pods or containers

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes