1KUBERNETES(1) Jan 2015 KUBERNETES(1)
2
3
4
6 kubectl create clusterrole - Create a ClusterRole.
7
8
9
11 kubectl create clusterrole [OPTIONS]
12
13
14
16 Create a ClusterRole.
17
18
19
21 --aggregation-rule=
22 An aggregation label selector for combining ClusterRoles.
23
24
25 --allow-missing-template-keys=true
26 If true, ignore any errors in templates when a field or map key is
27 missing in the template. Only applies to golang and jsonpath output
28 formats.
29
30
31 --dry-run="none"
32 Must be "none", "server", or "client". If client strategy, only
33 print the object that would be sent, without sending it. If server
34 strategy, submit server-side request without persisting the resource.
35
36
37 --non-resource-url=[]
38 A partial url that user should have access to.
39
40
41 -o, --output=""
42 Output format. One of:
43 json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file.
44
45
46 --resource=[]
47 Resource that the rule applies to
48
49
50 --resource-name=[]
51 Resource in the white list that the rule applies to, repeat this
52 flag for multiple items
53
54
55 --save-config=false
56 If true, the configuration of current object will be saved in its
57 annotation. Otherwise, the annotation will be unchanged. This flag is
58 useful when you want to perform kubectl apply on this object in the
59 future.
60
61
62 --template=""
63 Template string or path to template file to use when
64 -o=go-template, -o=go-template-file. The template format is golang
65 templates [ ⟨http://golang.org/pkg/text/template/#pkg-overview⟩].
66
67
68 --validate=true
69 If true, use a schema to validate the input before sending it
70
71
72 --verb=[]
73 Verb that applies to the resources contained in the rule
74
75
76
78 --add-dir-header=false
79 If true, adds the file directory to the header
80
81
82 --alsologtostderr=false
83 log to standard error as well as files
84
85
86 --application-metrics-count-limit=100
87 Max number of application metrics to store (per container)
88
89
90 --as=""
91 Username to impersonate for the operation
92
93
94 --as-group=[]
95 Group to impersonate for the operation, this flag can be repeated
96 to specify multiple groups.
97
98
99 --azure-container-registry-config=""
100 Path to the file containing Azure container registry configuration
101 information.
102
103
104 --boot-id-file="/proc/sys/kernel/random/boot_id"
105 Comma-separated list of files to check for boot-id. Use the first
106 one that exists.
107
108
109 --cache-dir="/builddir/.kube/http-cache"
110 Default HTTP cache directory
111
112
113 --certificate-authority=""
114 Path to a cert file for the certificate authority
115
116
117 --client-certificate=""
118 Path to a client certificate file for TLS
119
120
121 --client-key=""
122 Path to a client key file for TLS
123
124
125 --cloud-provider-gce-l7lb-src-cidrs=130.211.0.0/22,35.191.0.0/16
126 CIDRs opened in GCE firewall for L7 LB traffic proxy health checks
127
128
129 --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
130 CIDRs opened in GCE firewall for L4 LB traffic proxy health checks
131
132
133 --cluster=""
134 The name of the kubeconfig cluster to use
135
136
137 --container-hints="/etc/cadvisor/container_hints.json"
138 location of the container hints file
139
140
141 --containerd="/run/containerd/containerd.sock"
142 containerd endpoint
143
144
145 --containerd-namespace="k8s.io"
146 containerd namespace
147
148
149 --context=""
150 The name of the kubeconfig context to use
151
152
153 --default-not-ready-toleration-seconds=300
154 Indicates the tolerationSeconds of the toleration for
155 notReady:NoExecute that is added by default to every pod that does not
156 already have such a toleration.
157
158
159 --default-unreachable-toleration-seconds=300
160 Indicates the tolerationSeconds of the toleration for
161 unreachable:NoExecute that is added by default to every pod that does
162 not already have such a toleration.
163
164
165 --disable-root-cgroup-stats=false
166 Disable collecting root Cgroup stats
167
168
169 --docker="unix:///var/run/docker.sock"
170 docker endpoint
171
172
173 --docker-env-metadata-whitelist=""
174 a comma-separated list of environment variable keys that needs to
175 be collected for docker containers
176
177
178 --docker-only=false
179 Only report docker containers in addition to root stats
180
181
182 --docker-root="/var/lib/docker"
183 DEPRECATED: docker root is read from docker info (this is a
184 fallback, default: /var/lib/docker)
185
186
187 --docker-tls=false
188 use TLS to connect to docker
189
190
191 --docker-tls-ca="ca.pem"
192 path to trusted CA
193
194
195 --docker-tls-cert="cert.pem"
196 path to client certificate
197
198
199 --docker-tls-key="key.pem"
200 path to private key
201
202
203 --enable-load-reader=false
204 Whether to enable cpu load reader
205
206
207 --event-storage-age-limit="default=0"
208 Max length of time for which to store events (per type). Value is a
209 comma separated list of key values, where the keys are event types
210 (e.g.: creation, oom) or "default" and the value is a duration. Default
211 is applied to all non-specified event types
212
213
214 --event-storage-event-limit="default=0"
215 Max number of events to store (per type). Value is a comma
216 separated list of key values, where the keys are event types (e.g.:
217 creation, oom) or "default" and the value is an integer. Default is
218 applied to all non-specified event types
219
220
221 --global-housekeeping-interval=1m0s
222 Interval between global housekeepings
223
224
225 --housekeeping-interval=10s
226 Interval between container housekeepings
227
228
229 --insecure-skip-tls-verify=false
230 If true, the server's certificate will not be checked for validity.
231 This will make your HTTPS connections insecure
232
233
234 --kubeconfig=""
235 Path to the kubeconfig file to use for CLI requests.
236
237
238 --log-backtrace-at=:0
239 when logging hits line file:N, emit a stack trace
240
241
242 --log-cadvisor-usage=false
243 Whether to log the usage of the cAdvisor container
244
245
246 --log-dir=""
247 If non-empty, write log files in this directory
248
249
250 --log-file=""
251 If non-empty, use this log file
252
253
254 --log-file-max-size=1800
255 Defines the maximum size a log file can grow to. Unit is megabytes.
256 If the value is 0, the maximum file size is unlimited.
257
258
259 --log-flush-frequency=5s
260 Maximum number of seconds between log flushes
261
262
263 --logtostderr=true
264 log to standard error instead of files
265
266
267 --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
268 Comma-separated list of files to check for machine-id. Use the
269 first one that exists.
270
271
272 --match-server-version=false
273 Require server version to match client version
274
275
276 -n, --namespace=""
277 If present, the namespace scope for this CLI request
278
279
280 --password=""
281 Password for basic authentication to the API server
282
283
284 --profile="none"
285 Name of profile to capture. One of
286 (none|cpu|heap|goroutine|threadcreate|block|mutex)
287
288
289 --profile-output="profile.pprof"
290 Name of the file to write the profile to
291
292
293 --request-timeout="0"
294 The length of time to wait before giving up on a single server
295 request. Non-zero values should contain a corresponding time unit (e.g.
296 1s, 2m, 3h). A value of zero means don't timeout requests.
297
298
299 -s, --server=""
300 The address and port of the Kubernetes API server
301
302
303 --skip-headers=false
304 If true, avoid header prefixes in the log messages
305
306
307 --skip-log-headers=false
308 If true, avoid headers when opening log files
309
310
311 --stderrthreshold=2
312 logs at or above this threshold go to stderr
313
314
315 --storage-driver-buffer-duration=1m0s
316 Writes in the storage driver will be buffered for this duration,
317 and committed to the non memory backends as a single transaction
318
319
320 --storage-driver-db="cadvisor"
321 database name
322
323
324 --storage-driver-host="localhost:8086"
325 database host:port
326
327
328 --storage-driver-password="root"
329 database password
330
331
332 --storage-driver-secure=false
333 use secure connection with database
334
335
336 --storage-driver-table="stats"
337 table name
338
339
340 --storage-driver-user="root"
341 database username
342
343
344 --tls-server-name=""
345 Server name to use for server certificate validation. If it is not
346 provided, the hostname used to contact the server is used
347
348
349 --token=""
350 Bearer token for authentication to the API server
351
352
353 --update-machine-info-interval=5m0s
354 Interval between machine info updates.
355
356
357 --user=""
358 The name of the kubeconfig user to use
359
360
361 --username=""
362 Username for basic authentication to the API server
363
364
365 -v, --v=0
366 number for the log level verbosity
367
368
369 --version=false
370 Print version information and quit
371
372
373 --vmodule=
374 comma-separated list of pattern=N settings for file-filtered
375 logging
376
377
378
380 # Create a ClusterRole named "pod-reader" that allows user to perform "get", "watch" and "list" on pods
381 kubectl create clusterrole pod-reader --verb=get,list,watch --resource=pods
382
383 # Create a ClusterRole named "pod-reader" with ResourceName specified
384 kubectl create clusterrole pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod
385
386 # Create a ClusterRole named "foo" with API Group specified
387 kubectl create clusterrole foo --verb=get,list,watch --resource=rs.extensions
388
389 # Create a ClusterRole named "foo" with SubResource specified
390 kubectl create clusterrole foo --verb=get,list,watch --resource=pods,pods/status
391
392 # Create a ClusterRole name "foo" with NonResourceURL specified
393 kubectl create clusterrole "foo" --verb=get --non-resource-url=/logs/*
394
395 # Create a ClusterRole name "monitoring" with AggregationRule specified
396 kubectl create clusterrole monitoring --aggregation-rule="rbac.example.com/aggregate-to-monitoring=true"
397
398
399
400
402 kubectl-create(1),
403
404
405
407 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
408 com) based on the kubernetes source material, but hopefully they have
409 been automatically generated since!
410
411
412
413Eric Paris kubernetes User Manuals KUBERNETES(1)