Child processes in kubernetes

4/7/2019

I'm trying to deploy an instance of hubcommander in our kubernetes cluster. Unlike other apps we are running there, this app is using a shell script as an entrypoint, which launches the python process only after performing some bootstrap steps.
This presents a problem because the child process running python is not printing logs to stdout, and so when I try to troubleshoot the process by using kubectl logs <pod> I get nothing but the logs written by the entrypoint script.

This behaviour is not reproduced locally, where running the container in the exact same manner shows logs from both the main and the child process.

Is there any way to tell the bash script to execute python in the same PID? or make it send logs to the same stdout?

-- Yaron Idan
debugging
docker
kubernetes
linux
logging

1 Answer

4/16/2019

Eventually, I've found out the lack of logs has nothing to do with the creation of a child process.
It was rather due to the fact python buffers output by default.
Executing the process using the 'u' flag solved the issue for me.

-- Yaron Idan
Source: StackOverflow