<p>Does kubectl provide a way to copy files from pod in one namespace to another? I see we can copy files from pod to local machine and then copy them on another pod of different namespace. But can we copy directly from one namespace to another?</p>

<p>I tried:</p>

<p><code>kubectl cp &lt;namespace1&gt;/&lt;pod1&gt;:/tmp/foo.txt &lt;namespace2&gt;/&lt;pod1&gt;:/tmp/foo.txt</code></p>

<p>Looking at <code>kubectl cp</code> command help options I don't think there is any way to do that.</p>

codec
<p>Not really <code>kubectl cp</code> can only copy remote/local or local/remote, so unfortunately it's a 2 step process:</p>

<pre><code> $ kubectl cp &lt;namespace1&gt;/&lt;pod1&gt;:/tmp/foo.txt foo.txt
 $ kubectl cp foo.txt &lt;namespace2&gt;/&lt;pod1&gt;:/tmp/foo.txt
</code></pre>

<p>I would be nice to have a 1 step process, like <a href="https://rsync.samba.org/" rel="noreferrer">rsync</a>, but it is what it is as of this writing. I opened this <a href="https://github.com/kubernetes/kubectl/issues/551" rel="noreferrer">issue</a> to track it.</p>
