1OC(1)                              June 2016                             OC(1)
2
3
4

NAME

6       oc debug - Launch a new instance of a pod for debugging
7
8
9

SYNOPSIS

11       oc debug [OPTIONS]
12
13
14

DESCRIPTION

16       Launch a command shell to debug a running application
17
18
19       When  debugging  images and setup problems, it's useful to get an exact
20       copy of a running pod configuration  and  troubleshoot  with  a  shell.
21       Since  a  pod  that is failing may not be started and not accessible to
22       'rsh' or 'exec', the 'debug' command makes it easy to create  a  carbon
23       copy of that setup.
24
25
26       The  default  mode is to start a shell inside of the first container of
27       the referenced pod, replication controller, or deployment  config.  The
28       started  pod  will  be a copy of your source pod, with labels stripped,
29       the command changed to '/bin/sh', and  readiness  and  liveness  checks
30       disabled.  If you just want to run a command, add '--' and a command to
31       run. Passing a command will not create a TTY or send STDIN by  default.
32       Other  flags  are supported for altering the container or pod in common
33       ways.
34
35
36       A common problem running containers is a security policy that prohibits
37       you  from  running as a root user on the cluster. You can use this com‐
38       mand to test running a pod as non-root (with --as-user)  or  to  run  a
39       non-root pod as root (with --as-root).
40
41
42       The  debug  pod is deleted when the the remote command completes or the
43       user interrupts the shell.
44
45
46

OPTIONS

48       --allow-missing-template-keys=true
49           If true, ignore any errors in templates when a field or map key  is
50       missing  in  the  template.  Only applies to golang and jsonpath output
51       formats.
52
53
54       --as-root=false
55           If true, try to run the container as the root user
56
57
58       --as-user=-1
59           Try to run the container as a specific user UID (note:  admins  may
60       limit your ability to use this flag)
61
62
63       -c, --container=""
64           Container name; defaults to first container
65
66
67       --dry-run=false
68           If  true, only print the object that would be sent, without sending
69       it.
70
71
72       -f, --filename=[]
73           Filename, directory, or URL to files to read a template
74
75
76       --keep-annotations=false
77           If true, keep the original pod annotations
78
79
80       --keep-init-containers=true
81           Run the init containers for the pod. Defaults to true.
82
83
84       --keep-liveness=false
85           If true, keep the original pod liveness probes
86
87
88       --keep-readiness=false
89           If true, keep the original pod readiness probes
90
91
92       -I, --no-stdin=false
93           Bypasses passing STDIN to the container, defaults  to  true  if  no
94       command specified
95
96
97       -T, --no-tty=false
98           Disable pseudo-terminal allocation
99
100
101       --node-name=""
102           Set  a specific node to run on - by default the pod will run on any
103       valid node
104
105
106       --one-container=false
107           If true, run only the selected container, remove all others
108
109
110       -o, --output=""
111           Output format.  One  of:  json|yaml|name|go-template-file|template‐
112       file|template|go-template|jsonpath|jsonpath-file.
113
114
115       -R, --recursive=false
116           Process  the  directory  used in -f, --filename recursively. Useful
117       when you want to manage related manifests  organized  within  the  same
118       directory.
119
120
121       --show-labels=false
122           When  printing,  show  all  labels as the last column (default hide
123       labels column)
124
125
126       --template=""
127           Template string or path to template file  to  use  when  -o=go-tem‐
128       plate,  -o=go-template-file.  The template format is golang templates [
129http://golang.org/pkg/text/template/#pkg-overview⟩].
130
131
132       -t, --tty=false
133           Force a pseudo-terminal to be allocated
134
135
136

OPTIONS INHERITED FROM PARENT COMMANDS

138       --allow_verification_with_non_compliant_keys=false
139           Allow  a  SignatureVerifier  to  use  keys  which  are  technically
140       non-compliant with RFC6962.
141
142
143       --alsologtostderr=false
144           log to standard error as well as files
145
146
147       --application_metrics_count_limit=100
148           Max number of application metrics to store (per container)
149
150
151       --as=""
152           Username to impersonate for the operation
153
154
155       --as-group=[]
156           Group  to  impersonate for the operation, this flag can be repeated
157       to specify multiple groups.
158
159
160       --azure-container-registry-config=""
161           Path to the file containing Azure container registry  configuration
162       information.
163
164
165       --boot_id_file="/proc/sys/kernel/random/boot_id"
166           Comma-separated  list  of files to check for boot-id. Use the first
167       one that exists.
168
169
170       --cache-dir="/builddir/.kube/http-cache"
171           Default HTTP cache directory
172
173
174       --certificate-authority=""
175           Path to a cert file for the certificate authority
176
177
178       --client-certificate=""
179           Path to a client certificate file for TLS
180
181
182       --client-key=""
183           Path to a client key file for TLS
184
185
186       --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
187           CIDRs opened in GCE firewall for LB traffic proxy  health checks
188
189
190       --cluster=""
191           The name of the kubeconfig cluster to use
192
193
194       --container_hints="/etc/cadvisor/container_hints.json"
195           location of the container hints file
196
197
198       --containerd="unix:///var/run/containerd.sock"
199           containerd endpoint
200
201
202       --context=""
203           The name of the kubeconfig context to use
204
205
206       --default-not-ready-toleration-seconds=300
207           Indicates    the    tolerationSeconds   of   the   toleration   for
208       notReady:NoExecute that is added by default to every pod that does  not
209       already have such a toleration.
210
211
212       --default-unreachable-toleration-seconds=300
213           Indicates  the  tolerationSeconds  of  the  toleration for unreach‐
214       able:NoExecute that is added by default to  every  pod  that  does  not
215       already have such a toleration.
216
217
218       --docker="unix:///var/run/docker.sock"
219           docker endpoint
220
221
222       --docker-tls=false
223           use TLS to connect to docker
224
225
226       --docker-tls-ca="ca.pem"
227           path to trusted CA
228
229
230       --docker-tls-cert="cert.pem"
231           path to client certificate
232
233
234       --docker-tls-key="key.pem"
235           path to private key
236
237
238       --docker_env_metadata_whitelist=""
239           a  comma-separated  list of environment variable keys that needs to
240       be collected for docker containers
241
242
243       --docker_only=false
244           Only report docker containers in addition to root stats
245
246
247       --docker_root="/var/lib/docker"
248           DEPRECATED: docker root is read from docker info (this is  a  fall‐
249       back, default: /var/lib/docker)
250
251
252       --enable_load_reader=false
253           Whether to enable cpu load reader
254
255
256       --event_storage_age_limit="default=24h"
257           Max length of time for which to store events (per type). Value is a
258       comma separated list of key values, where  the  keys  are  event  types
259       (e.g.: creation, oom) or "default" and the value is a duration. Default
260       is applied to all non-specified event types
261
262
263       --event_storage_event_limit="default=100000"
264           Max number of events to store (per type). Value is  a  comma  sepa‐
265       rated  list  of  key values, where the keys are event types (e.g.: cre‐
266       ation, oom) or "default" and  the  value  is  an  integer.  Default  is
267       applied to all non-specified event types
268
269
270       --global_housekeeping_interval=0
271           Interval between global housekeepings
272
273
274       --housekeeping_interval=0
275           Interval between container housekeepings
276
277
278       --insecure-skip-tls-verify=false
279           If true, the server's certificate will not be checked for validity.
280       This will make your HTTPS connections insecure
281
282
283       --kubeconfig=""
284           Path to the kubeconfig file to use for CLI requests.
285
286
287       --log-flush-frequency=0
288           Maximum number of seconds between log flushes
289
290
291       --log_backtrace_at=:0
292           when logging hits line file:N, emit a stack trace
293
294
295       --log_cadvisor_usage=false
296           Whether to log the usage of the cAdvisor container
297
298
299       --log_dir=""
300           If non-empty, write log files in this directory
301
302
303       --logtostderr=true
304           log to standard error instead of files
305
306
307       --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
308           Comma-separated list of files to  check  for  machine-id.  Use  the
309       first one that exists.
310
311
312       --match-server-version=false
313           Require server version to match client version
314
315
316       -n, --namespace=""
317           If present, the namespace scope for this CLI request
318
319
320       --request-timeout="0"
321           The  length  of  time  to  wait before giving up on a single server
322       request. Non-zero values should contain a corresponding time unit (e.g.
323       1s, 2m, 3h). A value of zero means don't timeout requests.
324
325
326       -s, --server=""
327           The address and port of the Kubernetes API server
328
329
330       --stderrthreshold=2
331           logs at or above this threshold go to stderr
332
333
334       --storage_driver_buffer_duration=0
335           Writes  in  the  storage driver will be buffered for this duration,
336       and committed to the non memory backends as a single transaction
337
338
339       --storage_driver_db="cadvisor"
340           database name
341
342
343       --storage_driver_host="localhost:8086"
344           database host:port
345
346
347       --storage_driver_password="root"
348           database password
349
350
351       --storage_driver_secure=false
352           use secure connection with database
353
354
355       --storage_driver_table="stats"
356           table name
357
358
359       --storage_driver_user="root"
360           database username
361
362
363       --token=""
364           Bearer token for authentication to the API server
365
366
367       --user=""
368           The name of the kubeconfig user to use
369
370
371       -v, --v=0
372           log level for V logs
373
374
375       --version=false
376           Print version information and quit
377
378
379       --vmodule=
380           comma-separated list of pattern=N settings for  file-filtered  log‐
381       ging
382
383
384

EXAMPLE

386                # Debug a currently running deployment
387                oc debug dc/test
388
389                # Test running a deployment as a non-root user
390                oc debug dc/test --as-user=1000000
391
392                # Debug a specific failing container by running the env command in the 'second' container
393                oc debug dc/test -c second -- /bin/env
394
395                # See the pod that would be created to debug
396                oc debug dc/test -o yaml
397
398
399
400

SEE ALSO

402       oc(1),
403
404
405

HISTORY

407       June 2016, Ported from the Kubernetes man-doc generator
408
409
410
411Openshift                  Openshift CLI User Manuals                    OC(1)
Impressum