How to Configure EKS Multi Tenant

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up an eks multi tenant cluster by isolating teams into separate Kubernetes namespaces. Then you bind each team to strict role rules inside their assigned namespace. Many platform teams start by sharing one cluster to save money and reduce work. Still, broad permissions let one team read another team's secrets or break shared nodes. Careful role design keeps teams separate and protects shared cluster resources. How eks multi tenant role rules work Kubernetes role-based access control u

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 an eks multi tenant cluster by isolating teams into separate Kubernetes namespaces. Then you bind each team to strict role rules inside their assigned namespace. Many platform teams start by sharing one cluster to save money and reduce work. Still, broad permissions let one team read another team's secrets or break shared nodes. Careful role design keeps teams separate and protects shared cluster resources.

How eks multi tenant role rules work

Kubernetes role-based access control uses four main objects to manage permissions. A Role sets permissions inside one single namespace. A ClusterRole sets permissions across the whole cluster, including nodes and all namespaces. All rules in this system are additive, which means there are no deny rules. You start with zero permissions and add rules for each action a team needs.

To give a team permissions, you create a binding object. A RoleBinding grants permissions inside one specific namespace to a user or group. That RoleBinding can point to a local Role in that same namespace. It can also point to a shared ClusterRole while keeping the permissions inside one namespace. This pattern lets platform teams define one standard developer role and reuse it everywhere. By contrast, a ClusterRoleBinding grants access across the entire cluster at once. In a shared cluster, you should avoid ClusterRoleBindings for tenant teams. If you use one by mistake, that team gains permissions in every namespace.

Managing subresources and pod actions across namespaces

Kubernetes APIs also include subresources for actions like reading pod logs or running commands. Role rules name these subresources by adding a slash after the main resource name. For example, one subresource controls pod logs, and another controls running commands in pods. If a role allows pod command execution, users can open a shell inside containers. From there, they can inspect files, check memory, or call local network services.

Teams often try to limit subresource access to specific pod names using resource name lists. Still, resource name limits on create actions apply only to top-level resources, not subresources. This detail surprises many admins who try to lock down shell access to single pods. Once a developer has permission to run commands in a namespace, broad container access follows.

Multi-Factor Authentication (MFA) + EKS Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native namespace isolation leaves open

Native role bindings do a great job of deciding who can enter a namespace. They stop Team A from listing pods or reading secrets that belong to Team B. They also keep tenant teams from changing cluster-wide node settings.

Still, native roles only check permissions when a session or API call starts. Once a user opens a shell inside a pod, Kubernetes stops inspecting their actions. The cluster does not check which shell commands run inside that container. It also cannot rewrite sensitive data like emails, phone numbers, card numbers, or national IDs in output. Teams need deeper controls to inspect commands in flight and protect sensitive fields in results.

Add request guardrails and response masking beside Kubernetes

Cluster roles and service accounts govern who reaches the Kubernetes API. Still, a broad role or agent can delete workloads or print sensitive values from ConfigMaps and logs. In practice, hoop.dev sits inline beside the API server as a sidecar for your Kubernetes API. For every production API call an agent or human sends, hoop.dev decides whether to pass, mask, block, or escalate it for review alongside RBAC.

With hoop.dev Kubernetes controls, guardrails allow listing Secret names while refusing reads of Secret data before execution, and data masking redacts matched keys in returned JSON responses and log streams in memory. Furthermore, hoop.dev holds SOC 2 Type II and is MIT licensed on GitHub.

Frequently asked questions

Can I write a deny rule in Kubernetes RBAC to block one namespace?

No, Kubernetes role rules are only additive and do not support deny rules. To block access, remove broad cluster bindings and grant permissions per namespace with a RoleBinding.

How can I reuse one role definition across many tenant namespaces?

Define your standard permissions once inside a ClusterRole object. Then create a separate RoleBinding in each tenant namespace that points to that shared ClusterRole.

Why do developers still see sensitive data after I limit them to one namespace?

Namespace roles only decide who can open a pod shell or read logs. They do not inspect commands inside the shell or mask card numbers and emails in output.

The query runs. The emails stay hidden.