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

NAME

6       kubectl attach - Attach to a running container
7
8
9

SYNOPSIS

11       kubectl attach [OPTIONS]
12
13
14

DESCRIPTION

16       Attach  to  a  process  that is already running inside an existing con‐
17       tainer.
18
19
20

OPTIONS

22       -c, --container=""
23           Container name. If omitted, the first container in the pod will  be
24       chosen
25
26
27       --pod-running-timeout=1m0s
28           The  length  of time (like 5s, 2m, or 3h, higher than zero) to wait
29       until at least one pod is running
30
31
32       -i, --stdin=false
33           Pass stdin to the container
34
35
36       -t, --tty=false
37           Stdin is a TTY
38
39
40

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

303                # Get output from running pod 123456-7890, using the first container by default
304                kubectl attach 123456-7890
305
306                # Get output from ruby-container from pod 123456-7890
307                kubectl attach 123456-7890 -c ruby-container
308
309                # Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-7890
310                # and sends stdout/stderr from 'bash' back to the client
311                kubectl attach 123456-7890 -c ruby-container -i -t
312
313                # Get output from the first pod of a ReplicaSet named nginx
314                kubectl attach rs/nginx
315
316
317
318

SEE ALSO

320       kubectl(1),
321
322
323

HISTORY

325       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
326       com)  based  on the kubernetes source material, but hopefully they have
327       been automatically generated since!
328
329
330
331Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum