Skip to content

How to copy files into pods using kubectl?

To copy files into a pod we can use kubectl cp command.

Syntax

kubectl cp <file-name> <pod-name>:<path> --namespace <namespace> -c <service-name>

This is very similar to docker cp command.

Example

kubectl cp TestDag.py airflow-web-345345rr5-l4sr8:/opt/airflow/dags --namespace airflow -c airflow-web

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.