Containers are expected to write logs to standard output and standard error. The container runtime captures those streams into files on the node, and kubectl logs reads them through the kubelet. If an application writes only to a file inside the container, kubectl logs shows nothing; that is one reason for the sidecar pattern that tails such files to stdout.
Keep reading for free
Create a free StudyToCert account to read the rest of this lesson: 6 more sections, 4 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.