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

NAME

6       kubectl auth can-i - Check whether an action is allowed
7
8
9

SYNOPSIS

11       kubectl auth can-i [OPTIONS]
12
13
14

DESCRIPTION

16       Check whether an action is allowed.
17
18
19       VERB  is  a  logical  Kubernetes  API verb like 'get', 'list', 'watch',
20       'delete', etc. TYPE is a Kubernetes resource. Shortcuts and groups will
21       be  resolved.  NONRESOURCEURL is a partial URL starts with "/". NAME is
22       the name of a particular Kubernetes resource.
23
24
25

OPTIONS

27       --all-namespaces=false
28           If true, check the specified action in all namespaces.
29
30
31       -q, --quiet=false
32           If true, suppress output and just return the exit code.
33
34
35       --subresource=""
36           SubResource such as pod/log or deployment/scale
37
38
39

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

317                # Check to see if I can create pods in any namespace
318                kubectl auth can-i create pods --all-namespaces
319
320                # Check to see if I can list deployments in my current namespace
321                kubectl auth can-i list deployments.extensions
322
323                # Check to see if I can do everything in my current namespace ("*" means all)
324                kubectl auth can-i '*' '*'
325
326                # Check to see if I can get the job named "bar" in namespace "foo"
327                kubectl auth can-i list jobs.batch/bar -n foo
328
329                # Check to see if I can read pod logs
330                kubectl auth can-i get pods --subresource=log
331
332                # Check to see if I can access the URL /logs/
333                kubectl auth can-i get /logs/
334
335
336
337

SEE ALSO

339       kubectl-auth(1),
340
341
342

HISTORY

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