I am working with logs in my system.
I want to use a log sidecar to collect business container's log.
And my business container's log will write to its STDOUT.
So I want to redirect this STDOUT to pod's volume file, because in a pod all containers share the same volume, so my sidecar can collect log from volume.
How should I configuer this?
I mean maybe I should write some configuration in my k8s yaml so k8s will automaticlly redirect the container's STDOUT to pod's volume?
Adding this
2>&1 > /<your_path_to_volume_inside_pod>/file.log
to yourcommand
would redirectSTDOUT
andSTDERR
to a file