<p>I can login to a single container pod following the guidance from</p>
<p><a href="https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/</a></p>
<p>with</p>
<pre><code>kubectl exec --stdin --tty $POD_API -- /bin/bash
</code></pre>
<p>where $POD_API=api-79c8g4948d-24vth [or whatever kubernetes assigns to it]</p>
<p>However, I have a pod with 2 containers on it [one the cloudsql proxy and the other an api].</p>
<p>How can I login to my api container? My api container is named: api and the cloudsql proxy is named cloudsql-proxy.</p>

Mike
<p>Use <code>-c</code> to choose a container</p>
<pre><code>kubectl exec podname -c containername --stdin --tty -- /bin/bash
</code></pre>
<p>So in your case to login to api container</p>
<pre><code>kubectl exec $POD_API -c api --stdin --tty -- /bin/bash
</code></pre>
<p>and to login to cloudsql proxy container</p>
<pre><code>kubectl exec $POD_API -c cloudsql-proxy --stdin --tty -- /bin/bash
</code></pre>
