1KUBERNETES(1)                      Jan 2015                      KUBERNETES(1)
2
3
4

NAME

6       kubectl cp - Copy files and directories to and from containers.
7
8
9

SYNOPSIS

11       kubectl cp [OPTIONS]
12
13
14

DESCRIPTION

16       Copy files and directories to and from containers.
17
18
19

OPTIONS

21       -c, --container=""
22           Container  name. If omitted, the first container in the pod will be
23       chosen
24
25
26       --no-preserve=false
27           The copied file/directory's ownership and permissions will  not  be
28       preserved in the container
29
30
31

OPTIONS INHERITED FROM PARENT COMMANDS

33       --alsologtostderr=false
34           log to standard error as well as files
35
36
37       --application-metrics-count-limit=100
38           Max number of application metrics to store (per container)
39
40
41       --as=""
42           Username to impersonate for the operation
43
44
45       --as-group=[]
46           Group  to  impersonate for the operation, this flag can be repeated
47       to specify multiple groups.
48
49
50       --azure-container-registry-config=""
51           Path to the file containing Azure container registry  configuration
52       information.
53
54
55       --boot-id-file="/proc/sys/kernel/random/boot_id"
56           Comma-separated  list  of files to check for boot-id. Use the first
57       one that exists.
58
59
60       --cache-dir="/builddir/.kube/http-cache"
61           Default HTTP cache directory
62
63
64       --certificate-authority=""
65           Path to a cert file for the certificate authority
66
67
68       --client-certificate=""
69           Path to a client certificate file for TLS
70
71
72       --client-key=""
73           Path to a client key file for TLS
74
75
76       --cloud-provider-gce-lb-src-cidrs=130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16
77           CIDRs opened in GCE firewall for LB traffic proxy  health checks
78
79
80       --cluster=""
81           The name of the kubeconfig cluster to use
82
83
84       --container-hints="/etc/cadvisor/container_hints.json"
85           location of the container hints file
86
87
88       --containerd="/run/containerd/containerd.sock"
89           containerd endpoint
90
91
92       --containerd-namespace="k8s.io"
93           containerd namespace
94
95
96       --context=""
97           The name of the kubeconfig context to use
98
99
100       --default-not-ready-toleration-seconds=300
101           Indicates    the    tolerationSeconds   of   the   toleration   for
102       notReady:NoExecute that is added by default to every pod that does  not
103       already have such a toleration.
104
105
106       --default-unreachable-toleration-seconds=300
107           Indicates  the  tolerationSeconds  of  the  toleration for unreach‐
108       able:NoExecute that is added by default to  every  pod  that  does  not
109       already have such a toleration.
110
111
112       --docker="unix:///var/run/docker.sock"
113           docker endpoint
114
115
116       --docker-env-metadata-whitelist=""
117           a  comma-separated  list of environment variable keys that needs to
118       be collected for docker containers
119
120
121       --docker-only=false
122           Only report docker containers in addition to root stats
123
124
125       --docker-root="/var/lib/docker"
126           DEPRECATED: docker root is read from docker info (this is  a  fall‐
127       back, default: /var/lib/docker)
128
129
130       --docker-tls=false
131           use TLS to connect to docker
132
133
134       --docker-tls-ca="ca.pem"
135           path to trusted CA
136
137
138       --docker-tls-cert="cert.pem"
139           path to client certificate
140
141
142       --docker-tls-key="key.pem"
143           path to private key
144
145
146       --enable-load-reader=false
147           Whether to enable cpu load reader
148
149
150       --event-storage-age-limit="default=0"
151           Max length of time for which to store events (per type). Value is a
152       comma separated list of key values, where  the  keys  are  event  types
153       (e.g.: creation, oom) or "default" and the value is a duration. Default
154       is applied to all non-specified event types
155
156
157       --event-storage-event-limit="default=0"
158           Max number of events to store (per type). Value is  a  comma  sepa‐
159       rated  list  of  key values, where the keys are event types (e.g.: cre‐
160       ation, oom) or "default" and  the  value  is  an  integer.  Default  is
161       applied to all non-specified event types
162
163
164       --global-housekeeping-interval=1m0s
165           Interval between global housekeepings
166
167
168       --housekeeping-interval=10s
169           Interval between container housekeepings
170
171
172       --insecure-skip-tls-verify=false
173           If true, the server's certificate will not be checked for validity.
174       This will make your HTTPS connections insecure
175
176
177       --kubeconfig=""
178           Path to the kubeconfig file to use for CLI requests.
179
180
181       --log-backtrace-at=:0
182           when logging hits line file:N, emit a stack trace
183
184
185       --log-cadvisor-usage=false
186           Whether to log the usage of the cAdvisor container
187
188
189       --log-dir=""
190           If non-empty, write log files in this directory
191
192
193       --log-file=""
194           If non-empty, use this log file
195
196
197       --log-file-max-size=1800
198           Defines the maximum size a log file can grow to. Unit is megabytes.
199       If the value is 0, the maximum file size is unlimited.
200
201
202       --log-flush-frequency=5s
203           Maximum number of seconds between log flushes
204
205
206       --logtostderr=true
207           log to standard error instead of files
208
209
210       --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
211           Comma-separated  list  of  files  to  check for machine-id. Use the
212       first one that exists.
213
214
215       --match-server-version=false
216           Require server version to match client version
217
218
219       -n, --namespace=""
220           If present, the namespace scope for this CLI request
221
222
223       --password=""
224           Password for basic authentication to the API server
225
226
227       --profile="none"
228           Name of profile to capture. One of (none|cpu|heap|goroutine|thread‐
229       create|block|mutex)
230
231
232       --profile-output="profile.pprof"
233           Name of the file to write the profile to
234
235
236       --request-timeout="0"
237           The  length  of  time  to  wait before giving up on a single server
238       request. Non-zero values should contain a corresponding time unit (e.g.
239       1s, 2m, 3h). A value of zero means don't timeout requests.
240
241
242       -s, --server=""
243           The address and port of the Kubernetes API server
244
245
246       --skip-headers=false
247           If true, avoid header prefixes in the log messages
248
249
250       --skip-log-headers=false
251           If true, avoid headers when opening log files
252
253
254       --stderrthreshold=2
255           logs at or above this threshold go to stderr
256
257
258       --storage-driver-buffer-duration=1m0s
259           Writes  in  the  storage driver will be buffered for this duration,
260       and committed to the non memory backends as a single transaction
261
262
263       --storage-driver-db="cadvisor"
264           database name
265
266
267       --storage-driver-host="localhost:8086"
268           database host:port
269
270
271       --storage-driver-password="root"
272           database password
273
274
275       --storage-driver-secure=false
276           use secure connection with database
277
278
279       --storage-driver-table="stats"
280           table name
281
282
283       --storage-driver-user="root"
284           database username
285
286
287       --token=""
288           Bearer token for authentication to the API server
289
290
291       --update-machine-info-interval=5m0s
292           Interval between machine info updates.
293
294
295       --user=""
296           The name of the kubeconfig user to use
297
298
299       --username=""
300           Username for basic authentication to the API server
301
302
303       -v, --v=0
304           number for the log level verbosity
305
306
307       --version=false
308           Print version information and quit
309
310
311       --vmodule=
312           comma-separated list of pattern=N settings for  file-filtered  log‐
313       ging
314
315
316

EXAMPLE

318                # !!!Important Note!!!
319                # Requires that the 'tar' binary is present in your container
320                # image.  If 'tar' is not present, 'kubectl cp' will fail.
321
322                # Copy /tmp/foo_dir local directory to /tmp/bar_dir in a remote pod in the default namespace
323                kubectl cp /tmp/foo_dir <some-pod>:/tmp/bar_dir
324
325                # Copy /tmp/foo local file to /tmp/bar in a remote pod in a specific container
326                kubectl cp /tmp/foo <some-pod>:/tmp/bar -c <specific-container>
327
328                # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace <some-namespace>
329                kubectl cp /tmp/foo <some-namespace>/<some-pod>:/tmp/bar
330
331                # Copy /tmp/foo from a remote pod to /tmp/bar locally
332                kubectl cp <some-namespace>/<some-pod>:/tmp/foo /tmp/bar
333
334
335
336

SEE ALSO

338       kubectl(1),
339
340
341

HISTORY

343       January  2015,  Originally compiled by Eric Paris (eparis at redhat dot
344       com) based on the kubernetes source material, but hopefully  they  have
345       been automatically generated since!
346
347
348
349Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum