<p>I want to run a multi-container pod, and interactuate with it via a terminal.
With <code>kubectl run -ti</code> I can run a monocontainer pod and attach easily to it.</p>
<p>I think I have to <code>kubectl apply</code> to create a complex pod, and later <em>attach</em> to it.</p>
<p>I've tried this and it doesn't work:</p>
<pre><code>  kubectl run alpine --image alpine                                                                       pod/alpine created

  kubectl attach -i alpine                                                                                      If you don't see a command prompt, try pressing enter.
error: unable to upgrade connection: container alpine not found in pod alpine
</code></pre>
<p>I'm using latest <code>k3s v1.25.4+k3s1</code> under a Linux host (Ubuntu 22.04).</p>

david.perez
<p>This does work:</p>
<pre><code>  kubectl run alpine --image alpine --command sleep -- 999d                                               
pod/alpine created

  kubectl exec -ti alpine -- ash                                                                                
/ #
</code></pre>
<p>I need an auxiliary <code>sleep</code>.</p>
