<p>I'm working on a simple python 3 application that would be using print statements.
It is crutial for me to see the logs when i execute kubectl log command.
However, the logs are never present.
It looks like the application may not be running in the pod.
When i'm executing kubectl --it exexc and go in to pod I land up in working directory, then when i manually execute python myApp.py it is printing the logs.</p>
<p>My Dockerfile looks like this:</p>
<pre><code>FROM python:3.8-slim-buster

ENV PYTHONUNBUFFERED=0

WORKDIR /code

COPY . .

CMD [ &quot;python&quot;, &quot;/.main.py&quot; ]
</code></pre>
<p>For a simple example I can use a piece of code which just prints:</p>
<pre><code>from time import sleep

while True:
    print(&quot;Im printing ...&quot;)
    sleep(10)

</code></pre>
<p>My pod definition look like this:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: logbox
  namespace: default
spec:
  containers:
    - name: logbox
      image: &lt;8888888888888888&gt;logbox:0.0.1
      imagePullPolicy: &quot;IfNotPresent&quot;
      stdin: true
      args:
        - sh
        - -c
        - sleep infinity
</code></pre>

Michal
<p>It might be that the <code>args</code> commands in the pod definition are overriding the Dockerfile <code>CMD</code> command, I'd give it a try without the definition args or by matching them (so the args calls the <code>python ./main.py</code></p>
