<p>i have a simple automation to exec into a kubernetes pod but it always results in the below error :-</p>
<pre class="lang-shell prettyprint-override"><code>kubectl exec -it my-pod -c my-contaner -n my-namespace /bin/bash
Unable to use a TTY - input is not a terminal or the right kind of file
</code></pre>

<p>I am trying to run a simple shell script using jenkins to exec into a pod and execute ls -las in the root directory but its not allowing to exec into the pod automatically. The same thing works fine if i do manually on the linux server terminal.
Can someone help fix this issue</p>

<p>I got same error while creating a pod during <strong><em>Jenkins</em></strong> build:</p>

<pre><code>$ oc run netshoot-pod --attach=true --restart=Never --rm -i --tty --image nicolaka/netshoot -- curl $IP

Unable to use a TTY - input is not a terminal or the right kind of file 
If you don't see a command prompt, try pressing enter. 
Error attaching, falling back to logs
</code></pre>

<p><strong>Removing</strong> <code>--tty</code> / <code>-t</code> flag has fixed it.</p>
