Skip to content

How to copy files into pods using kubectl?

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


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

This is very similar to docker cp command.


kubectl cp airflow-web-345345rr5-l4sr8:/opt/airflow/dags --namespace airflow -c airflow-web
See also  Unable to connect to the server: x509: certificate signed by unknown authority - kubectl error when connecting to gcloud pods. How to fix?

Leave a Reply

Your email address will not be published.

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