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

EXAMPLE

302                # Check to see if I can create pods in any namespace
303                kubectl auth can-i create pods --all-namespaces
304
305                # Check to see if I can list deployments in my current namespace
306                kubectl auth can-i list deployments.extensions
307
308                # Check to see if I can do everything in my current namespace ("*" means all)
309                kubectl auth can-i '*' '*'
310
311                # Check to see if I can get the job named "bar" in namespace "foo"
312                kubectl auth can-i list jobs.batch/bar -n foo
313
314                # Check to see if I can read pod logs
315                kubectl auth can-i get pods --subresource=log
316
317                # Check to see if I can access the URL /logs/
318                kubectl auth can-i get /logs/
319
320
321
322

SEE ALSO

324       kubectl-auth(1),
325
326
327

HISTORY

329       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
330       com)  based  on the kubernetes source material, but hopefully they have
331       been automatically generated since!
332
333
334
335Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum