Kcna Kubernetes And Cloud Native Associate · Free Practice Question Easy

Question 65

What command is used to view information about all pods across all namespaces running on a Kubernetes cluster?

  • A

    kubectl describe pod all

  • B

    kubectl get pods --all-namespaces

  • C

    kubectl view pods

  • D

    kubectl describe pods-namespace all

Reveal correct answer

Correct answer: B

Explanation

The command used to view information about all pods across all namespaces running on a Kubernetes cluster is:

kubectl get pods --all-namespaces

This command provides a comprehensive list of all pods, regardless of the namespace in which they are deployed, along with their current status, IP addresses, and other relevant details.

https://kubernetes.io/docs/reference/kubectl/cheatsheet/#viewing-and-finding-resources

A. The command "kubectl describe pod all" is not the correct command to view information about all pods across all namespaces in a Kubernetes cluster. This command is used to describe a specific pod, not all pods, and it does not include the option to specify all namespaces.

B. The command "kubectl get pods --all-namespaces" is used to view information about all pods across all namespaces running on a Kubernetes cluster. This command provides a comprehensive overview of all pods in the cluster, regardless of the namespace they belong to.

C. The command "kubectl view pods" is not a valid command in Kubernetes. The correct command to view information about pods is "kubectl get pods" or "kubectl describe pods". Using an incorrect command like in this choice will result in an error and will not provide the desired information about all pods across all namespaces.

D. The command "kubectl describe pods-namespace all" is not a valid command in Kubernetes. The correct syntax for describing pods in a specific namespace is "kubectl describe pods -n ". Using incorrect syntax like in this choice will result in an error and will not provide the desired information.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need