You created a pod called "nginx" and its state is set to Pending.
Which command can you run to see the reason why the "nginx" pod is in the pending state? (Choose the best answer.)
Click on the arrows to vote for the correct answer
A. B. C. D.B.
https://github.com/kubernetes/kubernetes/issues/49314The correct answer is B. kubectl describe pod nginx.
Explanation: When a pod is in the "Pending" state, it means that the Kubernetes API server has created the pod object and assigned it to a node, but the container(s) within the pod have not yet been scheduled to run on the node. This can happen for a variety of reasons, such as resource constraints or pod scheduling conflicts.
To see the reason why the pod is in the pending state, you can use the kubectl describe command. This command will display detailed information about the specified pod, including its current status and any events related to the pod's lifecycle.
The kubectl logs command (answer A) is used to view the logs of a running container within a pod. However, if the pod is in the Pending state, the container is not yet running, so there will be no logs to view.
The kubectl get command (answer C) is used to retrieve basic information about Kubernetes resources, such as pods, services, and deployments. While this command can be used to check the status of a pod, it will not provide detailed information about why the pod is in the pending state.
Finally, while it is possible to view Kubernetes resources through the Oracle Cloud Infrastructure Console (answer D), this is not a command-line option and is not the best answer to the question posed.