<p>Please before you comment or answer, this question is about a CLI program, not a service. Apparently 90% of Kubernetes has to do with running services, so there is sparse documentation for CLI programs meant to be part of a pipeline workflow.</p>

<p>I have a command line program that uses stdout for JSON results.</p>

<p>I have a docker image for the command line program.</p>

<p>If I create the container as a Kubernetes Job, than stdout and stderr are mixed and require heuristic scrubbing to get pure JSON out.</p>

<p>The stderr messages are from native libraries outside of my direct control.</p>

<p>Supposedly, if I run <code>kubectl exec</code> against a running pod, I will get the normal stdout/stderr pipes.</p>

<p>Is there a way to just have the pod running without an entrypoint (or some dummy service entrypoint) with the sole purpose of running <code>kubectl exec</code> against it?</p>

<blockquote>
  <p>Is there a way to just have the pod running without an entrypoint [...]?</p>
</blockquote>

<p>A pod consists of one or more containers, each of which has an individual entrypoint.  It is certainly possible to run a <em>container</em> with a dummy command, for example, you can build an image with:</p>

<pre><code>CMD sleep inf
</code></pre>

<p>This will run a container that will persist until you kill it, and you could happily <code>docker exec</code> into it.</p>

<p>You can apply the same solution to k8s.  You could build an image as described above and deploy that in a pod, or you could use an existing image and simply set the command, as in:</p>

<pre><code>spec:
  containers:
  - name: mycontainer
    image: myexistingimage
    command: ["sleep", "inf"]
</code></pre>
