# RoleBinding

RoleBindingRoleBinding references a role, but does not contain it.apiVersion: rbac.authorization.k8s.io/v1import "k8s.io/api/rbac/v1"RoleBindingRoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace.apiVersion: rbac.authorization.k8s.io/v1kind: RoleBindingmetadata (ObjectMeta)Standard object's metadata.roleRef (RoleRef), requiredRoleRef can reference a Role in the current namespace or a ClusterRole in the global namespace. If the RoleRef cannot be resolved, the Authorizer must return an error. This field is immutable.RoleRef contains information that points to the role being usedroleRef.apiGroup (string), requiredAPIGroup is the group for the resource being referencedroleRef.kind (string), requiredKind is the type of resource being referencedroleRef.name (string), requiredName is the name of resource being referencedsubjects ([]Subject)Atomic: will be replaced during a mergeSubjects holds references to the objects the role applies to.Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names.subjects.kind (string), requiredKind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". If the Authorizer does not recognized the kind value, the Authorizer should report an error.subjects.name (string), requiredName of the object being referenced.subjects.apiGroup (string)APIGroup holds the API group of the referenced subject. Defaults to "" for ServiceAccount subjects. Defaults to "rbac.authorization.k8s.io" for User and Group subjects.subjects.namespace (string)Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty the Authorizer should report an error.RoleBindingListRoleBindingList is a collection of RoleBindingsapiVersion: rbac.authorization.k8s.io/v1kind: RoleBindingListmetadata (ListMeta)Standard object's metadata.items ([]RoleBinding), requiredItems is a list of RoleBindingsOperationsget read the specified RoleBindingHTTP RequestGET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}Parametersname (in path): string, requiredname of the RoleBindingnamespace (in path): string, requirednamespacepretty (in query): stringprettyResponse200 (RoleBinding): OK401: Unauthorizedlist list or watch objects of kind RoleBindingHTTP RequestGET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindingsParametersnamespace (in path): string, requirednamespaceallowWatchBookmarks (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 (RoleBindingList): OK401: Unauthorizedlist list or watch objects of kind RoleBindingHTTP RequestGET /apis/rbac.authorization.k8s.io/v1/rolebindingsParametersallowWatchBookmarks (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 (RoleBindingList): OK401: Unauthorizedcreate create a RoleBindingHTTP RequestPOST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindingsParametersnamespace (in path): string, requirednamespacebody: RoleBinding, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (RoleBinding): OK201 (RoleBinding): Created202 (RoleBinding): Accepted401: Unauthorizedupdate replace the specified RoleBindingHTTP RequestPUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}Parametersname (in path): string, requiredname of the RoleBindingnamespace (in path): string, requirednamespacebody: RoleBinding, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (RoleBinding): OK201 (RoleBinding): Created401: Unauthorizedpatch partially update the specified RoleBindingHTTP RequestPATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}Parametersname (in path): string, requiredname of the RoleBindingnamespace (in path): string, requirednamespacebody: Patch, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationforce (in query): booleanforcepretty (in query): stringprettyResponse200 (RoleBinding): OK201 (RoleBinding): Created401: Unauthorizeddelete delete a RoleBindingHTTP RequestDELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}Parametersname (in path): string, requiredname of the RoleBindingnamespace (in path): string, requirednamespacebody: DeleteOptionsdryRun (in query): stringdryRungracePeriodSeconds (in query): integergracePeriodSecondsignoreStoreReadErrorWithClusterBreakingPotential (in query): booleanignoreStoreReadErrorWithClusterBreakingPotentialpretty (in query): stringprettypropagationPolicy (in query): stringpropagationPolicyResponse200 (Status): OK202 (Status): Accepted401: Unauthorizeddeletecollection delete collection of RoleBindingHTTP RequestDELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindingsParametersnamespace (in path): string, requirednamespacebody: 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.