<p>I am writing a GitLab-ci.yaml file for my application and in that I have to run the kubectl command to get all pods after I ran the command I got the names of the pods which I need but ow the thing is I have to run kubectl cp command and need to copy a file into all three pods but I don't know the way to perform this action.</p>
<p>If anyone knows the way to do this activity then please reply.</p>
<p>Thanks</p>

Piyush Mittal
<pre><code>job:
  script:
    - |
      for pod in $(kubectl get po -o jsonpath='{.items[*].metadata.name} -n your-namespace')
      do 
        kubectl cp $(pwd)/some-file.txt your-namespace/$pod:/
      done
</code></pre>
