Building-permits engineers find kubectl logs empty even though the application writes detailed files under /var/log inside the container. What is the correct explanation?
Select an answer to reveal the explanation.
Short Explanation
kubectl logs isn't a file browser—it's a microphone on stdout and stderr. If the app only writes to /var/log/app.log, that mic hears silence until you redirect logging.
Full Explanation
The kubelet and container runtime expose stdout and stderr to kubectl logs. Applications that log only to files must be reconfigured to emit to those streams, or operators must use other mechanisms such as exec or sidecars to collect files. emptyDir and the Metrics API do not redefine this stdout/stderr contract.