<p>I want to do ssh between two pods in kubernetes. </p>

<p>Can anyone tell me how to do that? </p>

<p>Oversimplifying the answer, you can not.</p>

<p>That is, under "normal" circumstances... Your containers in pod launch single process, that is your application, be it nodejs, php, java or whatever, so they do not have a running SSH server inside their namespaces. Unless you explicitly run it by ie. running a "fat" container that launches a supervisor process (like ie. by using something like <code>phusion/baseimage</code> container) which by most in container world is considered an anti-pattern, or by running ssh in sidecar container, which will allow you to access that ssh server (but it will have it's own FS and potentially process tree, unless shared PID namespace is used).</p>

<p>As suggested in another answer, you could use serviceaccounts to grant your software rights to call kubernetes API and hence use things like ie. <code>kubectl exec</code>. Is it the right call for you... that depends on what you really want to achieve in the end.</p>
