Exam KCNA All QuestionsBrowse all questions from this exam
Question 61

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

    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
wdweOption: B

Should be B