OC-CREATE-CLUSTERROLE(1)
β¨ OC CREATE(1) β clusterrole edition, bestie β¨
Okay so this is oc create clusterrole, and it lives in the Openshift CLI User Manuals family of pages (the OC CREATE(1) squad, iykyk) π
It's been around since June 2016 and honestly it still slays.
πΈ NAME πΈ
oc create clusterrole β literally just: create a cluster role. That's the whole vibe. π
π¦ SYNOPSIS π¦
oc create clusterrole [OPTIONS]
π DESCRIPTION π
Create a cluster role. That's it, that's the description β short, sweet, main character energy. β¨
π₯ OPTIONS π₯
--aggregation-rule=β an aggregation label selector used for combining ClusterRoles together π«Ά--allow-missing-template-keys=trueβ if this istrue, any errors in templates get ignored when a field or map key is missing from the template. Heads up though: it only applies togolangandjsonpathoutput formats.--dry-run="none"β must be"none","server", or"client". If it's the client strategy, you only print the object that would be sent, without actually sending it π. If it's the server strategy, you submit a server-side request without persisting the resource.--field-manager="kubectl-create"β the name of the manager used to track field ownership, bestie.--non-resource-url=[]β a partial url that the user should have access to.-o,--output=""β output format, pick one pls: (json,yaml,kyaml,name,go-template,go-template-file,template,templatefile,jsonpath,jsonpath-as-json,jsonpath-file) π--resource=[]β the resource that the rule applies to.--resource-name=[]β resource in the white list that the rule applies to β repeat this flag for multiple items, no cap π§--save-config=falseβ iftrue, the configuration of the current object gets saved in its annotation. Otherwise the annotation stays unchanged. This flag is lowkey useful when you wanna performkubectl applyon this object later π--show-managed-fields=falseβ iftrue, keep the managedFields when printing objects in JSON or YAML format.--template=""β template string or path to a template file to use when-o=go-template,-o=go-template-file. The template format is golang templates [ β¨http://golang.org/pkg/text/template/#pkg-overviewβ© ].--validate="ignore"β must be one of:strict(ortrue),warn,ignore(orfalse). So"true"or"strict"will use a schema to validate the input and fail the request if it's invalid. It performs server-side validation ifServerSideFieldValidationis enabled on the api-server, but falls back to less reliable client-side validation if it's not π."warn"warns about unknown or duplicate fields without blocking the request if server-side field validation is enabled on the API server, and otherwise behaves as"ignore". And"false"or"ignore"performs no schema validation at all β silently dropping any unknown or duplicate fields π--verb=[]β the verb that applies to the resources contained in the rule.
π OPTIONS INHERITED FROM PARENT COMMANDS π
--as=""β username to impersonate for the operation. The user could be a regular user or a service account in a namespace.--as-group=[]β group to impersonate for the operation; this flag can be repeated to specify multiple groups.--as-uid=""β UID to impersonate for the operation.--as-user-extra=[]β user extras to impersonate for the operation; this flag can be repeated to specify multiple values for the same key.--cache-dir="/homeless-shelter/.kube/cache"β default cache directory.--certificate-authority=""β path to a cert file for the certificate authority.--client-certificate=""β path to a client certificate file for TLS.--client-key=""β path to a client key file for TLS.--cluster=""β the name of the kubeconfig cluster to use.--context=""β the name of the kubeconfig context to use.--disable-compression=falseβ iftrue, opt out of response compression for all requests to the server.--insecure-skip-tls-verify=falseβ iftrue, the server's certificate won't be checked for validity. > β οΈ This will make your HTTPS connections insecure, so likeβ¦ be careful bestie π--kubeconfig=""β path to the kubeconfig file to use for CLI requests.--kuberc=""β path to the kuberc file to use for preferences. This can be disabled by exportingKUBECTL_KUBERC=falsefeature gate, or by turning off the featureKUBERC=off.--match-server-version=falseβ require server version to match client version.-n,--namespace=""β if present, the namespace scope for this CLI request.--profile="none"β name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex).--profile-output="profile.pprof"β name of the file to write the profile to.--request-timeout="0"β the length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g.1s,2m,3h). A value of zero means don't timeout requests β°-s,--server=""β the address and port of the Kubernetes API server.--tls-server-name=""β server name to use for server certificate validation. If it isn't provided, the hostname used to contact the server is used.--token=""β bearer token for authentication to the API server.--user=""β the name of the kubeconfig user to use.--warnings-as-errors=falseβ treat warnings received from the server as errors and exit with a non-zero exit code π₯
π EXAMPLE π
# Create a cluster role named "pod-reader" that allows user to perform "get", "watch" and "list" on pods
oc create clusterrole pod-reader --verb=get,list,watch --resource=pods
# Create a cluster role named "pod-reader" with ResourceName specified
oc create clusterrole pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod
# Create a cluster role named "foo" with API Group specified
oc create clusterrole foo --verb=get,list,watch --resource=rs.apps
# Create a cluster role named "foo" with SubResource specified
oc create clusterrole foo --verb=get,list,watch --resource=pods,pods/status
# Create a cluster role name "foo" with NonResourceURL specified
oc create clusterrole "foo" --verb=get --non-resource-url=/logs/*
# Create a cluster role name "monitoring" with AggregationRule specified
oc create clusterrole monitoring --aggregation-rule="rbac.example.com/aggregate-to-monitoring=true"
π«Ά SEE ALSO π«Ά
π HISTORY π
June 2016 β Ported from the Kubernetes man-doc generator. So vintage, so iconic. π
And that's the whole page, bestie! π¦ Sourced from Openshift, straight out of the Openshift CLI User Manuals, dated June 2016 β periodt. π β¨
π¦ where this page comes from
- nixpkgs unstable: openshift 4.22.0-202605222050
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms