liveBook · Manning

Role-based access control

As explained in Google Anthos in Action

Role-based access control (RBAC) is an authorization model that grants permissions according to roles assigned to users or other principals.

Role-based access control (RBAC) authorizes access to Kubernetes objects through permissions associated with users or groups. In a shared cluster, it helps separate tenants’ access alongside resource quotas and network policies. section 13.3.1 section 3.2.6

Choose the scope of both the permissions and their assignment:

  • A Role holds permissions for its namespace; a ClusterRole holds permissions usable cluster-wide. section 3.2.6
  • A RoleBinding assigns permissions within its namespace; a ClusterRoleBinding assigns them cluster-wide. section 3.2.6

Access through Anthos Connect

A request from the Google Cloud UI travels through Connect using the user’s or service’s credentials, so existing cluster RBAC rules still apply. The requester must also have permission to view the Google Cloud project attached to the cluster. Cluster access alone therefore does not grant remote access through Connect. section 2.3.2

Table 3.6 Roles used in Kubernetes (view table figure)

Role type

Scope

Description

Role

Namespace

Permissions in a Role can be used only in the namespace in which it was created.

ClusterRole

Cluster

Permissions in a ClusterRole can be used cluster wide.

Compare the namespace and cluster scopes of Kubernetes roles. section 3.2.6

Table 3.7 Binding types and their scopes (view table figure)

Binding type

Scope

Description

RoleBinding

Namespace

Can be used to assign permissions only in the namespace in which it was created

ClusterRoleBinding

Cluster

Can be used to assign permissions cluster wide

Compare where each binding type can assign permissions. section 3.2.6

How Google Anthos in Action covers it

How deep it goes
Distinguishes namespace and cluster scopes for roles and bindings, but stops short of configuring RBAC policies.
Examples
Traces a Google Cloud UI request to a cluster and compares the scopes of Kubernetes roles and bindings.
What it assumes
Assumes a Kubernetes cluster context while defining namespaces as logical cluster partitions.
What you can do after
Evaluate/understand it by separating cluster RBAC authorization from the project permission required for access through Connect.
How it connects
Links RBAC to Kubernetes namespaces, multitenancy, Google Cloud IAM, and Anthos Connect.

Also explained in

Compare how 16 books explain role-based access control →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Google Anthos in Action. The section links point to the parts of the book it draws on.