Certified Kubernetes Administrator (CKA) Practice Test

Question: 1 / 400

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

kubectl get all --all-namespaces

kubectl list pods --all-namespaces

kubectl get pods --all-namespaces

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.

Get further explanation with Examzify DeepDiveBeta

kubectl show pods --all-namespaces

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy