Which command would you use to see all Pods in all namespaces?

Prepare for the Certified Kubernetes Administrator Exam with our in-depth quiz. Access flashcards and multiple-choice questions, each accompanied by hints and explanations. Ace your Kubernetes exam!

To view all Pods in all namespaces, the command kubectl get pods --all-namespaces is the correct choice. This command effectively retrieves a list of Pods across every namespace in the Kubernetes cluster.

The get verb is used in Kubernetes to list resources, and by specifying pods, you are instructing Kubernetes to focus specifically on Pod resources. The --all-namespaces flag ensures that the command does not limit the query to just the default namespace but instead includes every namespace present in the cluster.

Using kubectl get all --all-namespaces would indeed return various resources, but if the focus is solely on Pods, the command directly referencing pods provides a more concise and targeted response. The commands starting with list and show do not exist in the Kubernetes CLI context for retrieving Pod information, thus making them incompatible with the requirement of listing Pods.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy