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="/run/containerd/containerd.sock"
90           containerd endpoint
91
92
93       --containerd-namespace="k8s.io"
94           containerd namespace
95
96
97       --context=""
98           The name of the kubeconfig context to use
99
100
101       --default-not-ready-toleration-seconds=300
102           Indicates   the   tolerationSeconds   of   the    toleration    for
103       notReady:NoExecute  that is added by default to every pod that does not
104       already have such a toleration.
105
106
107       --default-unreachable-toleration-seconds=300
108           Indicates the tolerationSeconds  of  the  toleration  for  unreach‐
109       able:NoExecute  that  is  added  by  default to every pod that does not
110       already have such a toleration.
111
112
113       --docker="unix:///var/run/docker.sock"
114           docker endpoint
115
116
117       --docker-env-metadata-whitelist=""
118           a comma-separated list of environment variable keys that  needs  to
119       be collected for docker containers
120
121
122       --docker-only=false
123           Only report docker containers in addition to root stats
124
125
126       --docker-root="/var/lib/docker"
127           DEPRECATED:  docker  root is read from docker info (this is a fall‐
128       back, default: /var/lib/docker)
129
130
131       --docker-tls=false
132           use TLS to connect to docker
133
134
135       --docker-tls-ca="ca.pem"
136           path to trusted CA
137
138
139       --docker-tls-cert="cert.pem"
140           path to client certificate
141
142
143       --docker-tls-key="key.pem"
144           path to private key
145
146
147       --enable-load-reader=false
148           Whether to enable cpu load reader
149
150
151       --event-storage-age-limit="default=0"
152           Max length of time for which to store events (per type). Value is a
153       comma  separated  list  of  key  values, where the keys are event types
154       (e.g.: creation, oom) or "default" and the value is a duration. Default
155       is applied to all non-specified event types
156
157
158       --event-storage-event-limit="default=0"
159           Max  number  of  events to store (per type). Value is a comma sepa‐
160       rated list of key values, where the keys are event  types  (e.g.:  cre‐
161       ation,  oom)  or  "default"  and  the  value  is an integer. Default is
162       applied to all non-specified event types
163
164
165       --global-housekeeping-interval=1m0s
166           Interval between global housekeepings
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-file=""
195           If non-empty, use this log file
196
197
198       --log-file-max-size=1800
199           Defines the maximum size a log file can grow to. Unit is megabytes.
200       If the value is 0, the maximum file size is unlimited.
201
202
203       --log-flush-frequency=5s
204           Maximum number of seconds between log flushes
205
206
207       --logtostderr=true
208           log to standard error instead of files
209
210
211       --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
212           Comma-separated list of files to  check  for  machine-id.  Use  the
213       first one that exists.
214
215
216       --match-server-version=false
217           Require server version to match client version
218
219
220       -n, --namespace=""
221           If present, the namespace scope for this CLI request
222
223
224       --password=""
225           Password for basic authentication to the API server
226
227
228       --profile="none"
229           Name of profile to capture. One of (none|cpu|heap|goroutine|thread‐
230       create|block|mutex)
231
232
233       --profile-output="profile.pprof"
234           Name of the file to write the profile to
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       --skip-headers=false
248           If true, avoid header prefixes in the log messages
249
250
251       --skip-log-headers=false
252           If true, avoid headers when opening log files
253
254
255       --stderrthreshold=2
256           logs at or above this threshold go to stderr
257
258
259       --storage-driver-buffer-duration=1m0s
260           Writes in the storage driver will be buffered  for  this  duration,
261       and committed to the non memory backends as a single transaction
262
263
264       --storage-driver-db="cadvisor"
265           database name
266
267
268       --storage-driver-host="localhost:8086"
269           database host:port
270
271
272       --storage-driver-password="root"
273           database password
274
275
276       --storage-driver-secure=false
277           use secure connection with database
278
279
280       --storage-driver-table="stats"
281           table name
282
283
284       --storage-driver-user="root"
285           database username
286
287
288       --token=""
289           Bearer token for authentication to the API server
290
291
292       --update-machine-info-interval=5m0s
293           Interval between machine info updates.
294
295
296       --user=""
297           The name of the kubeconfig user to use
298
299
300       --username=""
301           Username for basic authentication to the API server
302
303
304       -v, --v=0
305           number for the log level verbosity
306
307
308       --version=false
309           Print version information and quit
310
311
312       --vmodule=
313           comma-separated  list  of pattern=N settings for file-filtered log‐
314       ging
315
316
317

EXAMPLE

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

SEE ALSO

351       kubectl(1),
352
353
354

HISTORY

356       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
357       com)  based  on the kubernetes source material, but hopefully they have
358       been automatically generated since!
359
360
361
362Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum