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="unix:///var/run/containerd.sock"
89           containerd endpoint
90
91
92       --context=""
93           The name of the kubeconfig context to use
94
95
96       --default-not-ready-toleration-seconds=300
97           Indicates    the    tolerationSeconds   of   the   toleration   for
98       notReady:NoExecute that is added by default to every pod that does  not
99       already have such a toleration.
100
101
102       --default-unreachable-toleration-seconds=300
103           Indicates  the  tolerationSeconds  of  the  toleration for unreach‐
104       able:NoExecute that is added by default to  every  pod  that  does  not
105       already have such a toleration.
106
107
108       --docker="unix:///var/run/docker.sock"
109           docker endpoint
110
111
112       --docker-env-metadata-whitelist=""
113           a  comma-separated  list of environment variable keys that needs to
114       be collected for docker containers
115
116
117       --docker-only=false
118           Only report docker containers in addition to root stats
119
120
121       --docker-root="/var/lib/docker"
122           DEPRECATED: docker root is read from docker info (this is  a  fall‐
123       back, default: /var/lib/docker)
124
125
126       --docker-tls=false
127           use TLS to connect to docker
128
129
130       --docker-tls-ca="ca.pem"
131           path to trusted CA
132
133
134       --docker-tls-cert="cert.pem"
135           path to client certificate
136
137
138       --docker-tls-key="key.pem"
139           path to private key
140
141
142       --enable-load-reader=false
143           Whether to enable cpu load reader
144
145
146       --event-storage-age-limit="default=0"
147           Max length of time for which to store events (per type). Value is a
148       comma separated list of key values, where  the  keys  are  event  types
149       (e.g.: creation, oom) or "default" and the value is a duration. Default
150       is applied to all non-specified event types
151
152
153       --event-storage-event-limit="default=0"
154           Max number of events to store (per type). Value is  a  comma  sepa‐
155       rated  list  of  key values, where the keys are event types (e.g.: cre‐
156       ation, oom) or "default" and  the  value  is  an  integer.  Default  is
157       applied to all non-specified event types
158
159
160       --global-housekeeping-interval=1m0s
161           Interval between global housekeepings
162
163
164       --housekeeping-interval=10s
165           Interval between container housekeepings
166
167
168       --insecure-skip-tls-verify=false
169           If true, the server's certificate will not be checked for validity.
170       This will make your HTTPS connections insecure
171
172
173       --kubeconfig=""
174           Path to the kubeconfig file to use for CLI requests.
175
176
177       --log-backtrace-at=:0
178           when logging hits line file:N, emit a stack trace
179
180
181       --log-cadvisor-usage=false
182           Whether to log the usage of the cAdvisor container
183
184
185       --log-dir=""
186           If non-empty, write log files in this directory
187
188
189       --log-file=""
190           If non-empty, use this log file
191
192
193       --log-flush-frequency=5s
194           Maximum number of seconds between log flushes
195
196
197       --logtostderr=true
198           log to standard error instead of files
199
200
201       --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
202           Comma-separated list of files to  check  for  machine-id.  Use  the
203       first one that exists.
204
205
206       --match-server-version=false
207           Require server version to match client version
208
209
210       --mesos-agent="127.0.0.1:5051"
211           Mesos agent address
212
213
214       --mesos-agent-timeout=10s
215           Mesos agent timeout
216
217
218       -n, --namespace=""
219           If present, the namespace scope for this CLI request
220
221
222       --password=""
223           Password for basic authentication to the API server
224
225
226       --profile="none"
227           Name of profile to capture. One of (none|cpu|heap|goroutine|thread‐
228       create|block|mutex)
229
230
231       --profile-output="profile.pprof"
232           Name of the file to write the profile to
233
234
235       --request-timeout="0"
236           The length of time to wait before giving  up  on  a  single  server
237       request. Non-zero values should contain a corresponding time unit (e.g.
238       1s, 2m, 3h). A value of zero means don't timeout requests.
239
240
241       -s, --server=""
242           The address and port of the Kubernetes API server
243
244
245       --skip-headers=false
246           If true, avoid header prefixes in the log messages
247
248
249       --stderrthreshold=2
250           logs at or above this threshold go to stderr
251
252
253       --storage-driver-buffer-duration=1m0s
254           Writes in the storage driver will be buffered  for  this  duration,
255       and committed to the non memory backends as a single transaction
256
257
258       --storage-driver-db="cadvisor"
259           database name
260
261
262       --storage-driver-host="localhost:8086"
263           database host:port
264
265
266       --storage-driver-password="root"
267           database password
268
269
270       --storage-driver-secure=false
271           use secure connection with database
272
273
274       --storage-driver-table="stats"
275           table name
276
277
278       --storage-driver-user="root"
279           database username
280
281
282       --token=""
283           Bearer token for authentication to the API server
284
285
286       --user=""
287           The name of the kubeconfig user to use
288
289
290       --username=""
291           Username for basic authentication to the API server
292
293
294       -v, --v=0
295           log level for V logs
296
297
298       --version=false
299           Print version information and quit
300
301
302       --vmodule=
303           comma-separated  list  of pattern=N settings for file-filtered log‐
304       ging
305
306
307

EXAMPLE

309                # !!!Important Note!!!
310                # Requires that the 'tar' binary is present in your container
311                # image.  If 'tar' is not present, 'kubectl cp' will fail.
312
313                # Copy /tmp/foo_dir local directory to /tmp/bar_dir in a remote pod in the default namespace
314                kubectl cp /tmp/foo_dir <some-pod>:/tmp/bar_dir
315
316                # Copy /tmp/foo local file to /tmp/bar in a remote pod in a specific container
317                kubectl cp /tmp/foo <some-pod>:/tmp/bar -c <specific-container>
318
319                # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace <some-namespace>
320                kubectl cp /tmp/foo <some-namespace>/<some-pod>:/tmp/bar
321
322                # Copy /tmp/foo from a remote pod to /tmp/bar locally
323                kubectl cp <some-namespace>/<some-pod>:/tmp/foo /tmp/bar
324
325
326
327

SEE ALSO

329       kubectl(1),
330
331
332

HISTORY

334       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
335       com)  based  on the kubernetes source material, but hopefully they have
336       been automatically generated since!
337
338
339
340Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum