<p>how i acces my namespace:  kubens namespace
how i access my pod: acces my container: kubectl exec -it hello-6b588fc8c-jz89q --container test  -- bash</p>
<p>i wante to cp a file from the filebeat container. but not work i try</p>

Ahmed Hilali
<p>From the <code>kubectl cp --help</code> output, an example is provided for your use case (copying from a remote pod to your local filesystem):</p>
<pre class="lang-sh prettyprint-override"><code># Copy /tmp/foo from a remote pod to /tmp/bar locally
kubectl cp &lt;some-namespace&gt;/&lt;some-pod&gt;:/tmp/foo /tmp/bar
</code></pre>
<p>In your case, I believe the command would be</p>
<pre class="lang-sh prettyprint-override"><code>kubectl cp &lt;namespace-of-pod&gt;/dsp-onboarding-6b588fc8c-jz89q:/app/data/logs/dsp-onboarding.json.log . -c filebeat
</code></pre>
<p>Note the <code>-c</code> option is necessary in your case, since you want to <code>cp</code> the file off of a specific container in the pod.</p>
