VCP-CMA 2024 Question 147
Select 2An administrator is troubleshooting a Kubernetes cluster deployed as part of a VMware Aria Automation setup. They need to retrieve the logs of a specific pod to investigate an issue. Which 'kubectl' commandlet options should they use?
- A
kubectl logs
- B
kubectl get pods
- C
kubectl describe pod
- D
kubectl logs
--previous - E
kubectl exec -it
-- /bin/bash
Show answer and explanation
Correct answers: A, D
Explanation
To investigate an issue with a pod, the 'kubectl logs
- A. Correct.
This command retrieves the logs of the specified pod, which is necessary for troubleshooting. It is a valid option.
- B. Incorrect.
This command lists all the pods in the cluster, but it does not retrieve logs. It is not relevant for the administrator’s requirement.
- C. Incorrect.
This command provides detailed information about the pod's configuration and status, but it does not retrieve logs. It is not the correct option for this scenario.
- D. Correct.
This command retrieves the logs from the previous instance of the pod, which can be useful if the pod has crashed or restarted recently. It is a valid option.
- E. Incorrect.
This command allows the administrator to execute commands inside a running pod but does not directly retrieve logs. It is not the correct option for this scenario.