<p>I am fairly new to the Google Cloud platform and Docker and set-up a cluster of nodes, made a Dockerfile that copies a repo and runs a Clojure REPL on a public port. I can connect to it from my IDE and play around with my code, awesome!</p>

<p>That REPL should however probably tunneled through SSH, but here is where my problem starts. <strong>I can't find a suitable place to SSH into</strong> for making changes to the repo that Docker runs the REPL on:</p>

<ul>
<li>The exposed IP just exposes the REPL service (correct kubernetes term?) and does not allow me to SSH in. </li>
<li>Neither does the cluster master endpoint, it gives me a public key error even though I've followed the <code>Adding or removing SSH keys for all of the instances in your project</code> part <a href="https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys" rel="noreferrer">here</a>.</li>
</ul>

<p>I would like to edit the source files via SSH but I would need to access the docker code repo. I don't know how to proceed.</p>

<p>I understand this isn't exactly a typical way to deploy applications so I am not even sure it's possible to have multiple nodes work with a modified docker codebase (do the nodes share the JVM somehow?).</p>

<p>Concretely my question is how do I SSH into the docker container to access the codebase?</p>

<p>For more recent Kubernetes versions the shell command should be separated by the <code>--</code>:</p>
<pre><code>kubectl exec -it &lt;POD NAME&gt; -c &lt;CONTAINER NAME&gt; -- bash
</code></pre>
<p>Please note that <code>bash</code> needs to be availalble for execution inside of the container. For different OS flavours you might need to use <code>/bin/sh</code>, <code>/bin/bash</code> (or others) instead.</p>
<p>The command format for Kubernetes 1.5.0:</p>
<pre><code>kubectl exec -it &lt;POD NAME&gt; -c &lt;CONTAINER NAME&gt; bash
</code></pre>
