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

NAME

6       kubectl  completion  -  Output  shell completion code for the specified
7       shell (bash or zsh)
8
9
10

SYNOPSIS

12       kubectl completion [OPTIONS]
13
14
15

DESCRIPTION

17       Output shell completion code for the specified shell (bash or zsh). The
18       shell  code  must  be  evaluated  to  provide interactive completion of
19       kubectl commands.  This can be done by sourcing it from the .bash _pro‐
20       file.
21
22
23       Detailed   instructions   on   how  to  do  this  are  available  here:
24https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-
25       shell-autocompletion⟩
26
27
28       Note  for zsh users: [1] zsh completions are only supported in versions
29       of zsh >= 5.2
30
31
32

OPTIONS INHERITED FROM PARENT COMMANDS

34       --alsologtostderr=false
35           log to standard error as well as files
36
37
38       --application-metrics-count-limit=100
39           Max number of application metrics to store (per container)
40
41
42       --as=""
43           Username to impersonate for the operation
44
45
46       --as-group=[]
47           Group to impersonate for the operation, this flag can  be  repeated
48       to specify multiple groups.
49
50
51       --azure-container-registry-config=""
52           Path  to the file containing Azure container registry configuration
53       information.
54
55
56       --boot-id-file="/proc/sys/kernel/random/boot_id"
57           Comma-separated list of files to check for boot-id. Use  the  first
58       one that exists.
59
60
61       --cache-dir="/builddir/.kube/http-cache"
62           Default HTTP cache directory
63
64
65       --certificate-authority=""
66           Path to a cert file for the certificate authority
67
68
69       --client-certificate=""
70           Path to a client certificate file for TLS
71
72
73       --client-key=""
74           Path to a client key file for TLS
75
76
77       --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
78           CIDRs opened in GCE firewall for LB traffic proxy  health checks
79
80
81       --cluster=""
82           The name of the kubeconfig cluster to use
83
84
85       --container-hints="/etc/cadvisor/container_hints.json"
86           location of the container hints file
87
88
89       --containerd="unix:///var/run/containerd.sock"
90           containerd endpoint
91
92
93       --context=""
94           The name of the kubeconfig context to use
95
96
97       --default-not-ready-toleration-seconds=300
98           Indicates   the   tolerationSeconds   of   the    toleration    for
99       notReady:NoExecute  that is added by default to every pod that does not
100       already have such a toleration.
101
102
103       --default-unreachable-toleration-seconds=300
104           Indicates the tolerationSeconds  of  the  toleration  for  unreach‐
105       able:NoExecute  that  is  added  by  default to every pod that does not
106       already have such a toleration.
107
108
109       --docker="unix:///var/run/docker.sock"
110           docker endpoint
111
112
113       --docker-env-metadata-whitelist=""
114           a comma-separated list of environment variable keys that  needs  to
115       be collected for docker containers
116
117
118       --docker-only=false
119           Only report docker containers in addition to root stats
120
121
122       --docker-root="/var/lib/docker"
123           DEPRECATED:  docker  root is read from docker info (this is a fall‐
124       back, default: /var/lib/docker)
125
126
127       --docker-tls=false
128           use TLS to connect to docker
129
130
131       --docker-tls-ca="ca.pem"
132           path to trusted CA
133
134
135       --docker-tls-cert="cert.pem"
136           path to client certificate
137
138
139       --docker-tls-key="key.pem"
140           path to private key
141
142
143       --enable-load-reader=false
144           Whether to enable cpu load reader
145
146
147       --event-storage-age-limit="default=0"
148           Max length of time for which to store events (per type). Value is a
149       comma  separated  list  of  key  values, where the keys are event types
150       (e.g.: creation, oom) or "default" and the value is a duration. Default
151       is applied to all non-specified event types
152
153
154       --event-storage-event-limit="default=0"
155           Max  number  of  events to store (per type). Value is a comma sepa‐
156       rated list of key values, where the keys are event  types  (e.g.:  cre‐
157       ation,  oom)  or  "default"  and  the  value  is an integer. Default is
158       applied to all non-specified event types
159
160
161       --global-housekeeping-interval=1m0s
162           Interval between global housekeepings
163
164
165       --housekeeping-interval=10s
166           Interval between container housekeepings
167
168
169       --insecure-skip-tls-verify=false
170           If true, the server's certificate will not be checked for validity.
171       This will make your HTTPS connections insecure
172
173
174       --kubeconfig=""
175           Path to the kubeconfig file to use for CLI requests.
176
177
178       --log-backtrace-at=:0
179           when logging hits line file:N, emit a stack trace
180
181
182       --log-cadvisor-usage=false
183           Whether to log the usage of the cAdvisor container
184
185
186       --log-dir=""
187           If non-empty, write log files in this directory
188
189
190       --log-file=""
191           If non-empty, use this log file
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       --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       --stderrthreshold=2
251           logs at or above this threshold go to stderr
252
253
254       --storage-driver-buffer-duration=1m0s
255           Writes  in  the  storage driver will be buffered for this duration,
256       and committed to the non memory backends as a single transaction
257
258
259       --storage-driver-db="cadvisor"
260           database name
261
262
263       --storage-driver-host="localhost:8086"
264           database host:port
265
266
267       --storage-driver-password="root"
268           database password
269
270
271       --storage-driver-secure=false
272           use secure connection with database
273
274
275       --storage-driver-table="stats"
276           table name
277
278
279       --storage-driver-user="root"
280           database username
281
282
283       --token=""
284           Bearer token for authentication to the API server
285
286
287       --user=""
288           The name of the kubeconfig user to use
289
290
291       --username=""
292           Username for basic authentication to the API server
293
294
295       -v, --v=0
296           log level for V logs
297
298
299       --version=false
300           Print version information and quit
301
302
303       --vmodule=
304           comma-separated list of pattern=N settings for  file-filtered  log‐
305       ging
306
307
308

EXAMPLE

310                # Installing bash completion on macOS using homebrew
311                ## If running Bash 3.2 included with macOS
312                brew install bash-completion
313                ## or, if running Bash 4.1+
314                brew install bash-completion@2
315                ## If kubectl is installed via homebrew, this should start working immediately.
316                ## If you've installed via other means, you may need add the completion to your completion directory
317                kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl
318
319
320                # Installing bash completion on Linux
321                ## If bash-completion is not installed on Linux, please install the 'bash-completion' package
322                ## via your distribution's package manager.
323                ## Load the kubectl completion code for bash into the current shell
324                source <(kubectl completion bash)
325                ## Write bash completion code to a file and source if from .bash_profile
326                kubectl completion bash >  /.kube/completion.bash.inc
327                printf "
328                # Kubectl shell completion
329                source '$HOME/.kube/completion.bash.inc'
330                " >> $HOME/.bash_profile
331                source $HOME/.bash_profile
332
333                # Load the kubectl completion code for zsh[1] into the current shell
334                source <(kubectl completion zsh)
335                # Set the kubectl completion code for zsh[1] to autoload on startup
336                kubectl completion zsh > "${fpath[1]}/_kubectl"
337
338
339
340

SEE ALSO

342       kubectl(1),
343
344
345

HISTORY

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