GKE Architecture
A gke architecture separates the managed control plane from the worker nodes that run containers. You set up permissions across this design by binding Kubernetes roles to team identities. Most teams start by mapping cloud groups to broad cluster roles for daily work. Overly broad roles let users run commands on any pod or read sensitive keys. How permissions work in a gke architecture Every request in a gke architecture goes through the Kubernetes API server first. The API server checks who s
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.
A gke architecture separates the managed control plane from the worker nodes that run containers. You set up permissions across this design by binding Kubernetes roles to team identities. Most teams start by mapping cloud groups to broad cluster roles for daily work. Overly broad roles let users run commands on any pod or read sensitive keys.
How permissions work in a gke architecture
Every request in a gke architecture goes through the Kubernetes API server first. The API server checks who sent the request and what rules apply to them. Kubernetes uses Role and ClusterRole objects to hold sets of permission rules. These rules are additive, which means there are no deny rules in the system.
A Role sets permissions inside a single namespace for a specific team or app. A ClusterRole sets permissions across the whole cluster, including nodes and all namespaces. To give these permissions to a user, you create a binding object. A RoleBinding grants permissions inside one namespace and can point to a Role. A RoleBinding can also point to a shared ClusterRole to save setup time. A ClusterRoleBinding grants permissions across the entire cluster at once.
Kubernetes also uses subresources to control specific actions like reading logs or running shells. In the API path, a subresource appears after a slash, such as pod logs. Admins must add explicit rules for pod log and pod exec subresources. Without these rules, a user can see a pod but cannot open a shell.
What native cluster roles solve and what they miss
Native Kubernetes roles do a good job of sorting users by namespace and resource. You can limit a developer to one namespace and block node changes across clusters. You can also separate read roles for pod logs from write roles for deployments. This keeps basic cluster boundaries clean when teams grow.
Zero Trust Architecture + GKE Workload Identity: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Still, native roles only check permissions when the API server receives the initial request. Once a role allows pod exec, the user opens an interactive shell session. Kubernetes does not inspect or block the individual shell commands inside that open session. A user with exec rights can read local files or dump memory inside pods.
Subresource rules also have limits when you try to restrict specific resource names. And because rules are only additive, you cannot write a quick rule to block one risky action. Teams also struggle when developers need temporary shell access to fix a live bug. Leaving pod exec roles attached all day increases risk across the whole cluster. Revoking and granting bindings by hand takes too much time during an outage. Also, native API logs record that an exec session started on a specific pod. They do not capture the actual output or sensitive data returned during that session.
Check Kubernetes API requests and responses on the wire
Kubernetes RBAC decides who may call the API server. RBAC does not check response payloads or split listing Secret names from reading Secret values when a role grants get access. With hoop.dev, you run an open-source HTTP proxy, a sidecar for your Kubernetes API. The kubectl client changes only the server address it talks to while RBAC stays in place.
On each call, hoop.dev guardrails read the method, normalized path, and headers to refuse bad deletes or full Secret reads with a 403 error. On the way back, hoop.dev data masking walks JSON responses by key and masks matched values in Secrets, ConfigMaps, and pod logs. Every request and verdict is logged without storing bearer tokens. View the project on GitHub.
Frequently asked questions
How does a Role differ from a ClusterRole in Kubernetes?
A Role applies only to resources inside a single namespace. A ClusterRole applies to cluster-wide resources like nodes or across all namespaces at once.
Can I write a deny rule in Kubernetes RBAC?
No, Kubernetes permissions are purely additive and do not support deny rules. You must start with zero permissions and only bind the exact rules needed.
How does Kubernetes control pod shell sessions?
Kubernetes controls shell sessions through the pod exec subresource in your role rules. If a binding allows that subresource, the user can run commands in the pod.
Related guides
In this post