<p>I have an ubuntu image that I use for debugging.
I do <code>kubectl attach my-app -c my-app -it</code> and then many <code>apt-get install</code> and other configurations I need.</p>
<p>The problem is when I exit <code>ctrl+c</code> the pod seems to get restarted and I loose all what I did
<br>Is there a way like <code>--restart=never</code> to avoid the container to be recreated</p>

Carlos Garcia
<p>Run another shell session <code>kubectl exec my-app -c my-app -it -- bash</code> to prepare your container. Alternately, if your pod spec has the following set to true:</p>
<pre><code>stdin: true 
tty: true 
</code></pre>
<p>You use the escape sequence Ctrl+P followed by Ctrl+Q to detach from the container after <code>kubectl attach -it</code> to the container.</p>
