GKE Subsetting

Published
Length
3 min read

Luis Felipe Dias

All posts

GKE subsetting divides cluster nodes into smaller backend groups for internal load balancers. This setup lets large clusters route network traffic without hitting backend limits. Teams use this feature to scale network routing across many nodes. Still, network groups do not restrict who can run commands on pods. When teams also grant broad cluster roles, users gain too much control. How gke subsetting and cluster roles work In a standard cluster, an internal load balancer sends traffic to all

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.

GKE subsetting divides cluster nodes into smaller backend groups for internal load balancers. This setup lets large clusters route network traffic without hitting backend limits. Teams use this feature to scale network routing across many nodes. Still, network groups do not restrict who can run commands on pods. When teams also grant broad cluster roles, users gain too much control.

How gke subsetting and cluster roles work

In a standard cluster, an internal load balancer sends traffic to all nodes. As the cluster grows, tracking every node in one pool hits scaling limits. Subsetting fixes this by picking a smaller group of nodes for each service. Traffic hits a node in that subset and routes to the right pod. This keeps network routing fast and stable as the cluster adds more workloads.

While network subsets manage service traffic, Kubernetes RBAC controls user actions on the API. A Role sets permissions inside one namespace. A ClusterRole sets permissions across all namespaces or for cluster-wide objects like nodes. Permissions are purely additive, which means there are no deny rules in RBAC. A RoleBinding grants those rules to a user inside a single namespace. A ClusterRoleBinding grants access across the entire cluster.

Why network subsets and RBAC leave an operational gap

Subsetting solves data plane routing, and RBAC decides who can log in. Together, they keep service traffic flowing and block unauthorized users from the API. RBAC even controls subresources like pod logs or pod command sessions. You define these subresources in rules by adding a slash after the resource name.

The gap appears after a user receives permission to open a pod shell. RBAC checks if the user can start the session, then steps out. It cannot inspect the individual commands that the engineer runs inside the container. It also cannot mask sensitive fields like emails, phone numbers, or card numbers. If a role allows log reading, the user gets every raw line. Because RBAC has no deny rules, teams struggle to block single risky commands. You need a way to check commands in flight and mask sensitive output.

Managing pod sessions and namespace boundaries

Most teams start by splitting workloads into separate namespaces for each app team. They create a RoleBinding in each namespace so engineers only touch their own pods. This aligns well with network subsets that isolate service traffic across node pools. Yet engineers still need shell access to debug broken apps during an incident.

GKE Workload Identity: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Granting pod exec rules in a Role gives full shell control inside that pod. From that shell, an engineer can read local files or query connected databases. Standard cluster logs show that a session started, not what the commands returned. Teams need fine-grained controls that act on each command and rewrite sensitive data.

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 runs as an open-source proxy, a sidecar for your Kubernetes API, checking requests and responses without replacing RBAC.

First, hoop.dev guardrails refuse banned methods, paths, or headers before they run. 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

Does GKE subsetting restrict user access to specific pods?

No, subsetting only groups nodes for internal load balancer traffic routing. You must use Kubernetes RBAC roles and bindings to limit user permissions.

Can Kubernetes RBAC deny a single command inside an exec session?

No, Kubernetes RBAC rules are purely additive and contain no deny rules. Once RBAC allows a pod exec subresource, it cannot filter shell commands.

How do RoleBindings and ClusterRoleBindings differ in scope?

A RoleBinding applies permissions inside one specific namespace only. A ClusterRoleBinding grants permissions across all namespaces and cluster-scoped resources like nodes.

Teams that document these role rules and review logs each month catch config drift early. Clear ownership for each role keeps live systems simple to run and easy to audit across the whole team.

The query runs. The emails stay hidden.