<p>I am running a jenkins pipeline with the following command:</p>

<pre><code>kubectl exec -it kafkacat-5f8fcfcc57-2txhc -- kafkacat -b cord-kafka -C -t BBSim-OLT-0-Events -o s@1585031458
</code></pre>

<p>which is running fine on the terminal of the machine the pipeline is running on, but on the actual pipeline I get the following error: "Unable to use a TTY - input is not a terminal or the right kind of file"</p>

<p>Any tips on how to go about resolving this?</p>

<p>When the flags <a href="https://kubernetes.io/docs/reference/kubectl/overview/" rel="noreferrer"><code>-it</code></a> are used with <code>kubectl exec</code>, it enables the TTY interactive mode. Given the error that you mentioned, it seems that Jenkins doesn't allocate a TTY.</p>

<p>Since you are running the command in a Jenkins job, I would assume that your command is not necessarily interactive. A possible solution for the problem would be to simply remove the <code>-t</code> flag and try to execute the following instead:</p>

<pre><code>kubectl exec -i kafkacat-5f8fcfcc57-2txhc -- kafkacat -b cord-kafka -C -t BBSim-OLT-0-Events -o s@1585031458
</code></pre>
