snippetkubernetesMajor
How to copy files recursively to a Kubernetes pod?
Viewed 0 times
kubernetesrecursivelyfileshowpodcopy
Problem
I want to copy files recursively to a Kubernetes pod
I tried
I got:
What are the best ways to transfer whole directories recursively into a pod.
I tried
kubectl cp -rI got:
error: unknown shorthand flag: 'r' in -rWhat are the best ways to transfer whole directories recursively into a pod.
Solution
kubectl cp by default does recursive copies when given a directory, although it seems to be picky about trailing slashes. If foo/bar is the directory you'd like to copy, simply runkubectl cp /path/to/foo/bar :/path/in/container/foo/Code Snippets
kubectl cp /path/to/foo/bar <pod-id>:/path/in/container/foo/Context
StackExchange DevOps Q#3127, answer score: 35
Revisions (0)
No revisions yet.