DCA · Question #117
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 logs deployment api
The correct answer is B. No. The kubectl logs command retrieves output from a container's stdout/stderr, not Kubernetes object events.
Question
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 logs deployment api
Options
- AYes
- BNo
How the community answered
(42 responses)- A5% (2)
- B95% (40)
Why each option
The `kubectl logs` command retrieves output from a container's stdout/stderr, not Kubernetes object events.
`kubectl logs` shows application output from containers, not system-level events for Kubernetes resources.
The `kubectl logs` command is used to stream or retrieve logs from containers running within a pod, not to display events related to a Kubernetes object like a Deployment. Kubernetes events provide a high-level timeline of what has happened to an object.
Concept tested: Kubernetes object events vs. container logs
Source: https://kubernetes.io/docs/reference/kubectl/cheatsheet/#inspecting-and-debugging
Topics
Community Discussion
No community discussion yet for this question.