How to Configure GKE Multi Tenant
You set up a gke multi tenant cluster by creating namespaces and binding Kubernetes RBAC roles to each team. This layout isolates workloads so different groups can share one cluster safely. Many teams start by giving developers broad cluster roles to speed up work. Broad permissions let users read or change resources in other namespaces by mistake. A strong setup limits each group to its own namespace and specific API actions. How gke multi tenant RBAC permissions work Kubernetes uses its aut
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You set up a gke multi tenant cluster by creating namespaces and binding Kubernetes RBAC roles to each team. This layout isolates workloads so different groups can share one cluster safely. Many teams start by giving developers broad cluster roles to speed up work. Broad permissions let users read or change resources in other namespaces by mistake. A strong setup limits each group to its own namespace and specific API actions.
How gke multi tenant RBAC permissions work
Kubernetes uses its authorization API group to control what users can do on the API server. You build access rules using two main objects called Role and ClusterRole. A Role always sets permissions inside a single namespace. A ClusterRole is not tied to one namespace. It can cover cluster-wide resources like nodes or apply across all namespaces.
In Kubernetes, all permission rules are additive. There are no deny rules in this system. You start with zero access and add rules for each resource and action. To give those permissions to a user or team, you create a binding.
A RoleBinding grants permissions inside one specific namespace. You can point a RoleBinding to a Role in that same namespace. You can also point a RoleBinding to a shared ClusterRole. This pattern helps in a shared cluster. You define one standard ClusterRole for developers and bind it per namespace. Each team gets the exact same rights, but only within its own space. By contrast, a ClusterRoleBinding grants permissions across the whole cluster. You should reserve ClusterRoleBindings for platform admins who manage shared nodes.
Controlling subresources in a shared namespace
Sharing a cluster also requires tight control over pod subresources. Kubernetes RBAC names resources the exact same way they appear in the API URL. Some API calls target a subresource attached to a pod. You write these in RBAC rules using a slash between the resource and subresource.
Two common examples are the subresources for pod logs and pod exec sessions. If a role allows pod log access, a user can read output from containers in that namespace. If a role allows the pod exec subresource, a user can open a shell inside a running container. You must grant these subresources with care in a shared cluster. Note that Kubernetes does not let you restrict create calls on subresources by specific resource names. If you grant exec rights in a namespace, the user can run commands on any pod there.
Multi-Factor Authentication (MFA) + GKE Workload Identity: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native namespace isolation solves and what it misses
Native namespaces and RoleBindings solve the first problem of sharing a cluster. They decide which team can reach which namespace on the API server. A developer in team A cannot list or delete pods owned by team B. This stops accidental changes across team lines during daily deploys.
Still, native RBAC stops at the API admission check. Once a RoleBinding lets an engineer open an exec shell or read logs, Kubernetes steps back. The native role does not inspect the shell commands that the user runs inside the container. It also cannot rewrite sensitive fields like emails, phone numbers, or card numbers in log output. Teams often share staging clusters that hold real customer records or shared secrets. Native RBAC decides who gets through the door, not what happens inside the active session.
Govern kubectl and API calls in flight
Identity providers and Kubernetes RBAC decide who logs into a cluster. They cannot redact keys inside returned JSON objects or hold a risky delete call for review. By design, hoop.dev sits inline as an open-source proxy, a sidecar for your Kubernetes API, without replacing RBAC. On every production call from an engineer or AI agent, hoop.dev decides to pass, mask, block, or hold it for human approval.
First, hoop.dev guardrails refuse banned methods, paths, or headers before they run or hold risky deletes for review. Next, hoop.dev data masking rewrites sensitive keys in returned Secret, ConfigMap, and log responses in memory, and writes each decision to the audit trail. Explore the repo on GitHub.
Frequently asked questions
Can I write a deny rule in Kubernetes RBAC to block one pod?
No, Kubernetes RBAC rules are strictly additive and do not support deny rules. To limit access, you must grant a smaller role that leaves out the unwanted permissions.
How should I reuse role definitions across many tenant namespaces?
Create one ClusterRole with the standard permissions you want each team to have. Then create a separate RoleBinding in each namespace that links that ClusterRole to the specific team.
Does a RoleBinding let users see cluster nodes?
No, a RoleBinding only grants access to resources that live inside its single namespace. Cluster-scoped items like nodes require a ClusterRoleBinding to grant access across the cluster.
Related guides
In this post