VCP-CMA 2024 Question 145
Single answerAn administrator is troubleshooting a Kubernetes cluster in the VMware Aria Automation Appliance. They need to check the current status of all pods running in the 'prod' namespace. Which 'kubectl' command should they use?
- A
kubectl get pods --namespace=prod
- B
kubectl describe pods --namespace=prod
- C
kubectl logs pods --namespace=prod
- D
kubectl get namespaces --all-namespaces
Show answer and explanation
Correct answer: A
Explanation
The 'kubectl get pods --namespace=prod' command is the most appropriate for checking the current status of all pods in the 'prod' namespace. While other commands provide additional or different information, they do not fulfill the requirement of listing the status of all pods in the specified namespace.
- A. Correct.
This command retrieves a list of all pods in the 'prod' namespace, including their current status. It is the correct choice for the given scenario.
- B. Incorrect.
This command provides detailed information about the configuration and status of a specific pod or pods, but it does not provide a simple status overview for all pods in the namespace. This is not the best choice for the scenario.
- C. Incorrect.
This command retrieves logs for specific pods but does not provide an overall status of all pods in the namespace. It is not suitable for the given requirement.
- D. Incorrect.
This command lists all namespaces in the cluster but does not provide any information about the pods within a specific namespace. It is irrelevant to the scenario.