How to Configure AKS Multi Tenant

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up an aks multi tenant cluster by giving each team a separate namespace. Then you link each namespace to strict role rules and network limits. Most teams start by sharing one cluster to save money and time. Still, broad permissions let one team read or change another team's apps. A single mistake with cluster-wide rights can break every app on the nodes. How an aks multi tenant setup works with roles Kubernetes uses Role-Based Access Control to manage what users and apps can do. The A

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 aks multi tenant cluster by giving each team a separate namespace. Then you link each namespace to strict role rules and network limits. Most teams start by sharing one cluster to save money and time. Still, broad permissions let one team read or change another team's apps. A single mistake with cluster-wide rights can break every app on the nodes.

How an aks multi tenant setup works with roles

Kubernetes uses Role-Based Access Control to manage what users and apps can do. The API server checks these rules before it allows any action. In this system, permissions only add rights, and there are no deny rules. You start with zero access and add only the rules each team needs.

A Role sets permissions inside one single namespace for a specific team. A ClusterRole sets rules across the whole cluster, including nodes and all namespaces. To give a team access, you create a RoleBinding inside their specific namespace. That RoleBinding links the team to a Role or a reusable ClusterRole. If you use a ClusterRoleBinding, you give access across every namespace at once. For safe tenant isolation, you should use RoleBindings scoped to single namespaces instead.

Managing subresources and day-to-day team access

Teams often need to read pod logs or run commands inside containers to fix bugs. Kubernetes treats pod logs and command execution as subresources under the pod API. You write these in your role rules with a slash, like pods and logs. If you grant broad subresource rights, users can run anything inside those containers.

Admins also need to keep workloads from taking all the memory and CPU. You can set resource quotas on each namespace to cap total memory and CPU use. You can also add network rules so pods in one namespace cannot talk to another. This keeps one noisy app from starving other teams on the same shared nodes.

Multi-Factor Authentication (MFA) + AKS Managed Identity: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native roles solve and the gap they leave

Native roles and bindings do a great job of deciding who can enter a namespace. They stop a developer on team A from deleting pods owned by team B. They also block users from viewing secrets stored in other namespaces on the cluster.

Still, native Kubernetes permissions stop checking once a user starts an active container session. When a developer gets rights to run commands in a pod, RBAC steps back. The cluster does not check what individual shell commands or database queries run next. It also cannot rewrite sensitive fields like emails, phone numbers, or card numbers in output. A user with exec rights can dump raw data or change files inside the pod. Standard cluster logs show that a session started, not what happened inside it.

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

What is the difference between a RoleBinding and a ClusterRoleBinding?

A RoleBinding grants permissions inside one specific namespace to keep teams separate. A ClusterRoleBinding grants permissions across the entire cluster and every namespace at once.

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

No, Kubernetes RBAC rules are purely additive and do not support deny rules. You must grant only the exact permissions a team needs from the start.

How can I reuse the same permission list across many tenant namespaces?

You can define one ClusterRole with the common rules your teams need. Then you reference that ClusterRole inside a separate RoleBinding in each team's namespace.

The query runs. The emails stay hidden.