<p>I have a pod running two containers, one of them is mysql container. I want to take dbdump from mysql container running in the pod and save that file dbdump on my system.</p>
<p>So that dbdump is coming out to my system from container running inside a pod</p>
<pre><code>mysqldump --user=&quot;user&quot; --password=&quot;Password&quot; abc_database &gt; dbdump.sql
</code></pre>

Alin
<p><code>kubectl exec</code> the command and redirect the output to a file. The redirection will occur locally on your system</p>
<pre><code>kubectl exec deployment/mysql -- \
  mysqldump --user=&quot;user&quot; --password=&quot;Password&quot; abc_database &gt; dbdump.sql
</code></pre>
