Kubectl cp: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 7: | Line 7: | ||
Copy files and directories to and from containers. | Copy files and directories to and from containers. | ||
kubectl cp | <font size="-1.5"> | ||
kubectl cp [''some-namespace''/]<''some-pod''>:/path/inside/the/first/container/of/the/pod /local/path | |||
</font> | |||
If the source | If the source is a directory, the entire content of the directory is copied recursively. | ||
If the source is a file, then the local path must specify a file name. | |||
A specific container is mentioned with -c <contrainer-name> | A specific container is mentioned with -c <contrainer-name> | ||
kubectl cp dev-local/k8sdeploy-m-01-84c6947c95-njrlz:/tmp/test-results.xml ./test-results.txt | kubectl cp dev-local/k8sdeploy-m-01-84c6947c95-njrlz:/tmp/test-results.xml ./test-results.txt |
Revision as of 00:09, 2 August 2024
Internal
Overview
Copy files and directories to and from containers.
kubectl cp [some-namespace/]<some-pod>:/path/inside/the/first/container/of/the/pod /local/path
If the source is a directory, the entire content of the directory is copied recursively.
If the source is a file, then the local path must specify a file name.
A specific container is mentioned with -c <contrainer-name>
kubectl cp dev-local/k8sdeploy-m-01-84c6947c95-njrlz:/tmp/test-results.xml ./test-results.txt