# ClusterRole

ClusterRoleClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.apiVersion: rbac.authorization.k8s.io/v1import "k8s.io/api/rbac/v1"ClusterRoleClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRolemetadata (ObjectMeta)Standard object's metadata.aggregationRule (AggregationRule)AggregationRule is an optional field that describes how to build the Rules for this ClusterRole. If AggregationRule is set, then the Rules are controller managed and direct changes to Rules will be stomped by the controller.AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRoleaggregationRule.clusterRoleSelectors ([]LabelSelector)Atomic: will be replaced during a mergeClusterRoleSelectors holds a list of selectors which will be used to find ClusterRoles and create the rules. If any of the selectors match, then the ClusterRole's permissions will be addedrules ([]PolicyRule)Atomic: will be replaced during a mergeRules holds all the PolicyRules for this ClusterRolePolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.rules.apiGroups ([]string)Atomic: will be replaced during a mergeAPIGroups is the name of the APIGroup that contains the resources. If multiple API groups are specified, any action requested against one of the enumerated resources in any API group will be allowed. "" represents the core API group and "*" represents all API groups.rules.resources ([]string)Atomic: will be replaced during a mergeResources is a list of resources this rule applies to. '*' represents all resources.rules.verbs ([]string), requiredAtomic: will be replaced during a mergeVerbs is a list of Verbs that apply to ALL the ResourceKinds contained in this rule. '*' represents all verbs.rules.resourceNames ([]string)Atomic: will be replaced during a mergeResourceNames is an optional white list of names that the rule applies to. An empty set means that everything is allowed.rules.nonResourceURLs ([]string)Atomic: will be replaced during a mergeNonResourceURLs is a set of partial urls that a user should have access to. *s are allowed, but only as the full, final step in the path Since non-resource URLs are not namespaced, this field is only applicable for ClusterRoles referenced from a ClusterRoleBinding. Rules can either apply to API resources (such as "pods" or "secrets") or non-resource URL paths (such as "/api"), but not both.ClusterRoleListClusterRoleList is a collection of ClusterRolesapiVersion: rbac.authorization.k8s.io/v1kind: ClusterRoleListmetadata (ListMeta)Standard object's metadata.items ([]ClusterRole), requiredItems is a list of ClusterRolesOperationsget read the specified ClusterRoleHTTP RequestGET /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}Parametersname (in path): string, requiredname of the ClusterRolepretty (in query): stringprettyResponse200 (ClusterRole): OK401: Unauthorizedlist list or watch objects of kind ClusterRoleHTTP RequestGET /apis/rbac.authorization.k8s.io/v1/clusterrolesParametersallowWatchBookmarks (in query): booleanallowWatchBookmarkscontinue (in query): stringcontinuefieldSelector (in query): stringfieldSelectorlabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondswatch (in query): booleanwatchResponse200 (ClusterRoleList): OK401: Unauthorizedcreate create a ClusterRoleHTTP RequestPOST /apis/rbac.authorization.k8s.io/v1/clusterrolesParametersbody: ClusterRole, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (ClusterRole): OK201 (ClusterRole): Created202 (ClusterRole): Accepted401: Unauthorizedupdate replace the specified ClusterRoleHTTP RequestPUT /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}Parametersname (in path): string, requiredname of the ClusterRolebody: ClusterRole, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (ClusterRole): OK201 (ClusterRole): Created401: Unauthorizedpatch partially update the specified ClusterRoleHTTP RequestPATCH /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}Parametersname (in path): string, requiredname of the ClusterRolebody: Patch, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationforce (in query): booleanforcepretty (in query): stringprettyResponse200 (ClusterRole): OK201 (ClusterRole): Created401: Unauthorizeddelete delete a ClusterRoleHTTP RequestDELETE /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}Parametersname (in path): string, requiredname of the ClusterRolebody: DeleteOptionsdryRun (in query): stringdryRungracePeriodSeconds (in query): integergracePeriodSecondsignoreStoreReadErrorWithClusterBreakingPotential (in query): booleanignoreStoreReadErrorWithClusterBreakingPotentialpretty (in query): stringprettypropagationPolicy (in query): stringpropagationPolicyResponse200 (Status): OK202 (Status): Accepted401: Unauthorizeddeletecollection delete collection of ClusterRoleHTTP RequestDELETE /apis/rbac.authorization.k8s.io/v1/clusterrolesParametersbody: DeleteOptionscontinue (in query): stringcontinuedryRun (in query): stringdryRunfieldSelector (in query): stringfieldSelectorgracePeriodSeconds (in query): integergracePeriodSecondsignoreStoreReadErrorWithClusterBreakingPotential (in query): booleanignoreStoreReadErrorWithClusterBreakingPotentiallabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettypropagationPolicy (in query): stringpropagationPolicyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondsResponse200 (Status): OK401: UnauthorizedThis page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.