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

EXAMPLE

336                # Installing bash completion on macOS using homebrew
337                ## If running Bash 3.2 included with macOS
338                brew install bash-completion
339                ## or, if running Bash 4.1+
340                brew install bash-completion@2
341                ## If kubectl is installed via homebrew, this should start working immediately.
342                ## If you've installed via other means, you may need add the completion to your completion directory
343                kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl
344
345
346                # Installing bash completion on Linux
347                ## If bash-completion is not installed on Linux, please install the 'bash-completion' package
348                ## via your distribution's package manager.
349                ## Load the kubectl completion code for bash into the current shell
350                source <(kubectl completion bash)
351                ## Write bash completion code to a file and source if from .bash_profile
352                kubectl completion bash >  /.kube/completion.bash.inc
353                printf "
354                # Kubectl shell completion
355                source '$HOME/.kube/completion.bash.inc'
356                " >> $HOME/.bash_profile
357                source $HOME/.bash_profile
358
359                # Load the kubectl completion code for zsh[1] into the current shell
360                source <(kubectl completion zsh)
361                # Set the kubectl completion code for zsh[1] to autoload on startup
362                kubectl completion zsh > "${fpath[1]}/_kubectl"
363
364
365
366

SEE ALSO

368       kubectl(1),
369
370
371

HISTORY

373       January 2015, Originally compiled by Eric Paris (eparis at redhat dot
374       com) based on the kubernetes source material, but hopefully they have
375       been automatically generated since!
376
377
378
379Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum