You are troubleshooting a Kubernetes deployment called api, and want to see the events table for this object.
Does this command display it?
Solution:kubectl get deployment api
Correct Answer: B
The command kubectl get deployment api will only show the status of the deployment object, such as the number of replicas, available pods, and updated pods1. It will not display the events table for the deployment, which contains information about the creation, scaling, and updating of the deployment and its pods2. To see the events table for the deployment, you need to use the kubectl describe deployment api command, which will show the details of the deployment object, including the events3. Alternatively, you can use the kubectl get events --field-selector involvedObject.name=api command, which will filter the events by the name of the involved object4. Reference:
Kubectl: Get Deployments - Kubernetes - ShellHacks
Events in Kubernetes | Kubernetes
kubectl Cheat Sheet | Kubernetes
kubernetes - kubectl get events only for a pod - Stack Overflow