Skip to main content

Role Binding

RoleBinding is a cloud resource that grants permissions to a user or set of users within a Kubernetes namespace. It binds a specified role to a user or set of users, defining what actions they can perform within that namespace. For further details, you can refer to the official Kubernetes RoleBinding documentation.

Terraform Mappings:

  • kubernetes_role_binding.metadata[0].name
  • kubernetes_role_binding_v1.metadata[0].name

Supported Methods​

  • GET: Get a RoleBinding by name
  • LIST: List all RoleBindings
  • SEARCH: Search for a RoleBinding using the ListOptions JSON format e.g. ("labelSelector": "app=wordpress")

Role​

RoleBinding is directly related to a Role in that it associates the permissions defined in a Role with a user or set of users, enabling controlled access within a namespace.

ClusterRole​

RoleBinding can also bind a ClusterRole to users within a namespace, offering cluster-scoped permissions but limited to a specific namespace, unlike ClusterRoleBinding, which grants cluster-wide permissions.

ServiceAccount​

RoleBinding can associate a ServiceAccount with a set of permissions as defined by a Role or ClusterRole, enabling applications running in pods within that namespace to perform actions based on those permissions.