KCNA Exam QuestionsBrowse all questions from this exam

KCNA Exam - Question 61


How do you perform a command in a running container of a Pod?

Show Answer
Correct Answer: A

To perform a command in a running container of a Pod in Kubernetes, you should use 'kubectl exec <pod> -- <command>'. This is the standard way to execute commands inside a container in a Kubernetes Pod. The 'docker exec' command is specific to Docker and not applicable in the context of Kubernetes. 'kubectl run' is used to start a new pod rather than execute a command in an existing one. 'kubectl attach' is generally used to attach to a running container but not for executing arbitrary commands within it.

Discussion

1 comment
Sign in to comment
wdweOption: B
Mar 20, 2024

Should be B