A Kubernetes namespace is a naming and policy scope, not a security boundary, so a shared cluster only isolates tenants when RBAC, quotas, network policy, admission control and node or runtime isolation are layered on top of it. Platform teams share clusters to cut cost and operational effort, whether the tenants are internal teams or external customers of a SaaS product. This guide explains the tenancy models the Kubernetes project describes, from namespace per tenant to virtual control planes and dedicated clusters, and the controls that turn each into a real boundary: namespace RBAC, ResourceQuota and LimitRange, default-deny NetworkPolicy and DNS restrictions, Pod Security Admission, node isolation and sandboxed runtimes. It is written for platform engineers and security architects designing or reviewing shared clusters. For the wider hardening baseline see the Kubernetes Security Guide; for accelerators see GPU and AI Cluster Multi Tenancy Security.
Key takeaways
- Hardness is a spectrum. The Kubernetes docs describe soft multi-tenancy (tenants trust each other to a degree) and hard multi-tenancy (tenants do not), and treat the difference as a broad spectrum, not a switch.
- Authorisation is the main control plane boundary. Namespace-scoped RBAC, granted with RoleBindings and least privilege, is what stops one tenant reading or changing another's API objects.
- The data plane is shared by default. All pods can talk to each other and cluster DNS answers across namespaces until NetworkPolicy and DNS policy say otherwise, and network policy only works with a CNI plugin that enforces it.
- Containers share a kernel. For untrusted code, add dedicated nodes per tenant or sandboxed runtimes (a VM or userspace kernel per pod) selected with RuntimeClass.
- Cluster-scoped objects need their own answer. Namespace per tenant cannot isolate CustomResourceDefinitions, StorageClasses or webhooks; a virtual control plane per tenant can, at higher cost, but still leaves the data plane to you.
Tenancy models
The Kubernetes multi-tenancy documentation separates two use cases. In multi-team tenancy, internal teams share a cluster and often have direct access with kubectl or through GitOps controllers; there is usually some trust between them. In multi-customer tenancy, a provider runs workloads for customers who have no cluster access, and workloads must be strongly isolated from each other. Organisations often run both, so decide per cluster which model applies before choosing controls.
| Model | What tenants share | Isolation strength | Cost and effort | Typical fit |
|---|---|---|---|---|
| Namespace per tenant (soft) | API server, etcd, nodes, kernel, network | Control plane isolation through RBAC and policy; data plane shared | Lowest resource cost; most configuration work | Internal teams with a common employer and trusted code |
| Namespace per tenant plus dedicated nodes | API server, etcd, kubelet trust model; not nodes | Reduces noisy neighbours and limits the reach of a container escape | Moderate; per-node billing is simple | Regulated teams, customers with predictable load |
| Namespace per tenant plus sandboxed runtime | API server, nodes; not the host kernel interface | Stronger workload isolation for untrusted code | Runtime overhead and compatibility testing | Running customer-supplied code or plugins |
| Virtual control plane per tenant | Worker nodes of a host cluster | Isolates cluster-scoped objects and control plane noisy neighbours; data plane still shared | Extra API server, controller manager and datastore per tenant | Tenants that need CRDs, webhooks or cluster-admin-like rights |
| Dedicated cluster per tenant (hard) | Possibly the cloud account or hardware | Strongest; failures and compromise stay in one cluster | Highest; fleet management needed | Mutually untrusted customers, strict regulatory separation |
Decision guidance: start from the trust question. If a tenant compromise or a malicious tenant must never reach another tenant's data, plan for hard isolation (dedicated nodes plus sandboxing at minimum, or separate clusters). If tenants are teams under one security policy, a well-built namespace per tenant model is usually enough. Small organisations rarely gain from virtual control planes; large platform teams with hundreds of tenants often combine namespace tenancy for most teams with dedicated clusters for the few that need them. Name namespaces uniquely across the whole fleet, as the Kubernetes docs suggest, so tenants can move between shared and dedicated clusters later.
Namespaces as boundaries
Namespaces give two kinds of isolation: object names can repeat across namespaces, and many policies (Roles, RoleBindings, NetworkPolicy, ResourceQuota, Pod Security Admission labels) are namespace-scoped. The Kubernetes docs recommend giving every workload its own namespace, even when one tenant runs several workloads, so policies can be fine-grained. What a namespace does not separate:
- Cluster-scoped resources: Nodes, PersistentVolumes, StorageClasses, CustomResourceDefinitions, ClusterRoles, admission webhooks and RuntimeClasses are shared by all tenants. Keep create and update rights on them with the platform team.
- Nodes and kernel: pods from different namespaces can land on the same node and share its kernel unless scheduling rules prevent it.
- Network and DNS: without policy, pods reach any pod and resolve any Service name.
- Storage reuse: PersistentVolumes are cluster-wide even though claims are namespaced. Use dynamic provisioning, avoid node-local volume types, give tenants their own StorageClass where possible and set the reclaim policy to Delete on any shared class.
Standardise what a tenant namespace contains at creation: labels identifying the tenant, a ResourceQuota, a LimitRange, default-deny NetworkPolicies, Pod Security Admission labels and RoleBindings. See the Kubernetes Namespace Onboarding Checklist.
RBAC and quotas
The Kubernetes docs call authorisation the most important type of isolation for the control plane. Grant tenants rights with RoleBindings in their own namespaces, never ClusterRoleBindings, and split a namespace when a role would otherwise grant more than needed.
| Built-in ClusterRole (bound with a RoleBinding) | What it allows in the namespace | Tenancy caveat |
|---|---|---|
| admin | Read and write on most resources, including creating Roles and RoleBindings in the namespace | No write access to ResourceQuota or the Namespace object, so tenants cannot raise their own limits |
| edit | Read and write on most objects; cannot view or modify Roles or RoleBindings | Can access Secrets and run pods as any ServiceAccount in the namespace, so it effectively holds every ServiceAccount's API rights there |
| view | Read-only on most objects | Cannot read Secrets, because Secret contents expose ServiceAccount credentials |
- Escalation verbs: creating a Role requires holding its permissions or the escalate verb, and creating a RoleBinding requires the bound permissions or the bind verb. Never grant escalate, bind or impersonate to tenants. See Kubernetes escalate and bind Verbs and the Kubernetes RBAC Guide.
- ResourceQuota: limits compute and the number of API objects (pods, ConfigMaps, Services) per namespace, reducing noisy neighbour effects. Once a compute quota applies, containers must declare requests and limits. Quotas apply within one namespace only and do not cover everything, such as network traffic.
- LimitRange: sets default requests and limits and per-container minimums and maximums, so pods without values are still admitted under quota. The ResourceQuota and LimitRanger admission plugins enforce these objects and are in the default enabled set.
- API Priority and Fairness: where tenants run controllers that call the API server, assign them priority levels so one tenant cannot starve the control plane.
- Pod priority: restrict which PriorityClasses tenants may use, because the scheduler can pre-empt lower-priority pods to place higher-priority ones.
Where identity fits: every tenant namespace contains ServiceAccounts, and with the edit role a tenant user can act as any of them. Turn off token automounting where it is not needed, give each workload its own ServiceAccount and never bind tenant ServiceAccounts to cluster-scoped roles. See the Kubernetes NHI Security Guide.
Network isolation
By default every pod can reach every other pod and traffic is unencrypted. The Kubernetes docs recommend starting each tenant namespace with a default-deny policy plus a rule that allows DNS lookups, then adding allow rules inside the namespace. Avoid an empty namespaceSelector ({}) in policies, because it matches every namespace.
| Layer | Control | Notes |
|---|---|---|
| Pod to pod (L3/L4) | NetworkPolicy default deny for ingress and egress per namespace | Ignored unless the CNI plugin enforces NetworkPolicy: test it |
| DNS | CoreDNS policy limiting lookups to the tenant's namespace | Cluster DNS answers across all namespaces by default |
| Egress | Egress NetworkPolicy, egress gateway or cloud firewall | Block cloud instance metadata endpoints from tenant pods unless needed |
| Service to service (L7) | Service mesh authorisation and mutual TLS | Adds identity-based policy and encryption; see below |
| External exposure | Restrict Service type LoadBalancer and NodePort, Ingress or Gateway ownership; DenyServiceExternalIPs admission plugin | DenyServiceExternalIPs rejects new use of the Service externalIPs field; disabled by default |
Network policies apply within one control plane: pods in different virtual control planes cannot reach each other through Kubernetes networking. See the Kubernetes Network Policy Guide and Kubernetes Network Policies vs Service Mesh Policies.
Runtime and node isolation
Containers are processes on a shared kernel, which is a weaker boundary than a virtual machine. A container escape (ATT&CK T1611 Escape to Host) on a shared node puts every co-located tenant at risk. Three layers address this, and hard multi-tenancy usually needs more than one.
- Pod Security Admission: label every tenant namespace with pod-security.kubernetes.io/enforce: restricted (or baseline where restricted breaks a workload, with a dated exception). The PodSecurity admission plugin has been stable since v1.25 and replaced PodSecurityPolicy. Tenants must not be able to change namespace labels. See the Kubernetes Pod Security Standards and Pod Security Admission Guide.
- User namespaces: map container root to an unprivileged host user to reduce the impact of an escape. See the Kubernetes User Namespaces Guide.
- Node isolation: dedicate node pools to a tenant with taints, tolerations and node affinity, enforced so tenants cannot add their own tolerations. The PodNodeSelector and PodTolerationRestriction admission plugins (both alpha and disabled by default) or a policy engine can force namespace-level node selectors and allowed tolerations. Enable NodeRestriction so a kubelet can only modify its own Node and the pods bound to it, and cannot change node-restriction.kubernetes.io/ labels used to steer tenants. The kubelet trust model and the API server stay shared, so the docs note a skilled attacker could still move laterally.
- Sandboxed runtimes: RuntimeClass (node.k8s.io/v1, stable since v1.20) maps a pod's runtimeClassName to a CRI handler configured in containerd or CRI-O. Its scheduling field steers pods to nodes that have the runtime, and overhead tells the scheduler what the sandbox costs. gVisor (OCI runtime runsc) runs a userspace application kernel that services system calls itself; Kata Containers runs each pod in a lightweight VM with its own kernel. Test compatibility and performance: gVisor documents that not every system call is implemented, and both add overhead.
- Image cache: the AlwaysPullImages admission plugin forces imagePullPolicy Always, so one tenant cannot run another tenant's private image that is already cached on a shared node without valid credentials.
| Option | Protects against | Trade-off |
|---|---|---|
| Restricted Pod Security Standard | Privileged pods, host namespaces, hostPath, added capabilities | Some workloads need changes; low cost |
| Dedicated nodes per tenant | Noisy neighbours, cross-tenant reach after an escape | Lower bin-packing efficiency; shared kubelet and API server remain |
| Userspace kernel sandbox | Direct host kernel attack surface | System call overhead, compatibility gaps |
| VM-per-pod sandbox | Kernel-level escape to the host | Needs virtualisation support on nodes; memory overhead per pod |
Control plane per tenant
A virtual control plane gives each tenant its own API server, controller manager and datastore while worker nodes stay in a shared host cluster (sometimes called a super-cluster). A synchronisation controller copies the objects needed to run pods between the tenant control plane and the host. The Kubernetes docs list the gains: isolation of cluster-scoped resources, no control plane noisy neighbours, a smaller blast radius for a bad policy and no conflicts between tenants' CRDs and webhooks. The costs are more resources and more components to patch and back up, plus per-tenant DNS. It does not solve data plane isolation, so the node and runtime controls above still apply.
- Choose it when: tenants need to install CRDs, operators or admission webhooks, or expect cluster-admin-like rights, but dedicated clusters per tenant are too costly.
- Avoid it when: tenants only deploy applications; namespace tenancy is simpler and cheaper.
- Move to dedicated clusters when: contracts or regulators require physical or account-level separation, or tenants are mutually hostile.
Multi-tenant operators need care in any model: they should create resources in tenant namespaces, set requests and limits on the pods they create and support node isolation and sandboxed runtimes. An operator with cluster-wide write rights is a cross-tenant path. See Kubernetes Operator Security.
Detection and measurement
- Audit logs: alert on tenant identities creating ClusterRoleBindings, changing namespace labels, using escalate, bind or impersonate, or touching another tenant's namespace (ATT&CK T1613 Container and Resource Discovery). See the Kubernetes Audit Log Detection Guide.
- Runtime signals: privileged containers, hostPath mounts or unexpected pods in tenant namespaces (T1610 Deploy Container), exec into pods (T1609 Container Administration Command) and sustained CPU spikes that suggest T1496 Resource Hijacking.
- Policy drift: scheduled checks that every tenant namespace still has quota, LimitRange, default-deny policies and enforce labels.
Metrics that show the boundary holds:
- Share of tenant namespaces with all baseline objects present (target 100%).
- Number of tenant subjects with any cluster-scoped binding (target zero).
- Share of tenant namespaces enforcing the restricted Pod Security Standard.
- Cross-namespace connections denied versus allowed by policy, reviewed monthly.
- Untrusted-code workloads running on sandboxed runtimes or dedicated nodes (target 100%).
- Time from tenant offboarding to namespace, volume and credential removal.
Framework mapping
| Control area | NIST CSF 2.0 | NIST SP 800-53 Rev 5 | ATT&CK techniques addressed |
|---|---|---|---|
| Namespace RBAC | PR.AA-05 | AC-3, AC-6 | T1613 |
| Quotas and priority | PR.IR-04 | SC-6 | T1496 |
| Network policy and DNS | PR.IR-01 | SC-7 | T1613 |
| Pod security, sandboxing, node isolation | PR.PS-01 | SC-39, CM-7 | T1611, T1610 |
| Storage and image cache separation | PR.IR-01 | SC-4 | T1610 |
Common failure patterns
- Namespace treated as the boundary: tenants separated by namespace only, with no NetworkPolicy, so any compromised pod can reach every other tenant's services.
- NetworkPolicy without enforcement: policies written for a CNI that ignores them, giving false assurance.
- edit granted as "safe": tenant users given edit without realising it exposes every ServiceAccount and Secret in the namespace.
- Tenants control their own labels: a tenant with rights on its Namespace object relaxes Pod Security Admission labels or node selectors.
- Shared StorageClass with Retain: released volumes rebound to another tenant's claim.
- Untrusted code on shared nodes: customer plugins running with the default runtime beside other customers' workloads.
Practitioner checklist
- Record the tenancy model and trust level for each cluster, and move tenants that need hard isolation to dedicated nodes, sandboxes or clusters.
- Create tenant namespaces from one template with labels, ResourceQuota, LimitRange, default-deny ingress and egress plus DNS allow, and restricted Pod Security Admission labels.
- Bind tenant users with RoleBindings to admin, edit or view (or narrower custom Roles), knowing what edit implies; never grant escalate, bind or impersonate.
- Keep cluster-scoped resources (CRDs, StorageClasses, webhooks, RuntimeClasses, PriorityClasses) under platform team control.
- Confirm the CNI enforces NetworkPolicy and restrict CoreDNS lookups to the tenant's namespace where tenants are untrusted.
- Enable NodeRestriction and AlwaysPullImages, and enforce tenant node selectors and tolerations.
- Run untrusted code under a sandboxed RuntimeClass on dedicated nodes, after compatibility testing.
- Alert on cross-namespace access and cluster-scoped binding changes, and track the six metrics above.
- Offboard tenants completely: workloads, volumes, ServiceAccounts, external credentials and DNS records.
Standards and references
- Kubernetes: Multi-tenancy
- Kubernetes: Using RBAC Authorization
- Kubernetes: Admission Control in Kubernetes
- Kubernetes: Runtime Class
- gVisor: Documentation
- Kata Containers: Project overview
Related NHI Mgmt Group resources: Kubernetes Security Guide · Kubernetes RBAC Guide · Multi-Tenant SaaS Authorisation and Tenant Isolation Guide · GPU and AI Cluster Multi Tenancy Security