1KUBERNETES(1) Jan 2015 KUBERNETES(1)
2
3
4
6 kubectl cp - Copy files and directories to and from containers.
7
8
9
11 kubectl cp [OPTIONS]
12
13
14
16 Copy files and directories to and from containers.
17
18
19
21 -c, --container=""
22 Container name. If omitted, the first container in the pod will be
23 chosen
24
25
26
28 --allow-verification-with-non-compliant-keys=false
29 Allow a SignatureVerifier to use keys which are technically
30 non-compliant with RFC6962.
31
32
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 --google-json-key=""
165 The Google Cloud Platform Service Account JSON Key to use for
166 authentication.
167
168
169 --housekeeping-interval=10s
170 Interval between container housekeepings
171
172
173 --insecure-skip-tls-verify=false
174 If true, the server's certificate will not be checked for validity.
175 This will make your HTTPS connections insecure
176
177
178 --kubeconfig=""
179 Path to the kubeconfig file to use for CLI requests.
180
181
182 --log-backtrace-at=:0
183 when logging hits line file:N, emit a stack trace
184
185
186 --log-cadvisor-usage=false
187 Whether to log the usage of the cAdvisor container
188
189
190 --log-dir=""
191 If non-empty, write log files in this directory
192
193
194 --log-flush-frequency=5s
195 Maximum number of seconds between log flushes
196
197
198 --logtostderr=true
199 log to standard error instead of files
200
201
202 --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
203 Comma-separated list of files to check for machine-id. Use the
204 first one that exists.
205
206
207 --match-server-version=false
208 Require server version to match client version
209
210
211 --mesos-agent="127.0.0.1:5051"
212 Mesos agent address
213
214
215 --mesos-agent-timeout=10s
216 Mesos agent timeout
217
218
219 -n, --namespace=""
220 If present, the namespace scope for this CLI request
221
222
223 --request-timeout="0"
224 The length of time to wait before giving up on a single server
225 request. Non-zero values should contain a corresponding time unit (e.g.
226 1s, 2m, 3h). A value of zero means don't timeout requests.
227
228
229 -s, --server=""
230 The address and port of the Kubernetes API server
231
232
233 --stderrthreshold=2
234 logs at or above this threshold go to stderr
235
236
237 --storage-driver-buffer-duration=1m0s
238 Writes in the storage driver will be buffered for this duration,
239 and committed to the non memory backends as a single transaction
240
241
242 --storage-driver-db="cadvisor"
243 database name
244
245
246 --storage-driver-host="localhost:8086"
247 database host:port
248
249
250 --storage-driver-password="root"
251 database password
252
253
254 --storage-driver-secure=false
255 use secure connection with database
256
257
258 --storage-driver-table="stats"
259 table name
260
261
262 --storage-driver-user="root"
263 database username
264
265
266 --token=""
267 Bearer token for authentication to the API server
268
269
270 --user=""
271 The name of the kubeconfig user to use
272
273
274 -v, --v=0
275 log level for V logs
276
277
278 --version=false
279 Print version information and quit
280
281
282 --vmodule=
283 comma-separated list of pattern=N settings for file-filtered log‐
284 ging
285
286
287
289 # !!!Important Note!!!
290 # Requires that the 'tar' binary is present in your container
291 # image. If 'tar' is not present, 'kubectl cp' will fail.
292
293 # Copy /tmp/foo_dir local directory to /tmp/bar_dir in a remote pod in the default namespace
294 kubectl cp /tmp/foo_dir <some-pod>:/tmp/bar_dir
295
296 # Copy /tmp/foo local file to /tmp/bar in a remote pod in a specific container
297 kubectl cp /tmp/foo <some-pod>:/tmp/bar -c <specific-container>
298
299 # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace <some-namespace>
300 kubectl cp /tmp/foo <some-namespace>/<some-pod>:/tmp/bar
301
302 # Copy /tmp/foo from a remote pod to /tmp/bar locally
303 kubectl cp <some-namespace>/<some-pod>:/tmp/foo /tmp/bar
304
305
306
307
309 kubectl(1),
310
311
312
314 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
315 com) based on the kubernetes source material, but hopefully they have
316 been automatically generated since!
317
318
319
320Eric Paris kubernetes User Manuals KUBERNETES(1)