Course contentsShow
← Security
Lesson 1976 of 3,05239. Cloud Security - Compute and ServerlessFree lesson

Multi-Tenancy and Cluster Isolation

Understand namespace isolation, cluster multi-tenancy patterns, and when to use separate clusters for security boundaries.

Multi-Tenancy and Cluster Isolation

What you'll learn: How to safely share Kubernetes clusters between teams or applications while maintaining strong security boundaries.

The Core Challenge

Multi-tenancy in Kubernetes means running workloads from different teams, projects, or trust levels in the same cluster. The fundamental question is: How much isolation do you need? Think of it like an apartment building versus separate houses—apartments share infrastructure (plumbing, power) but need strong walls between units. Houses offer complete separation but cost more.

Namespace Isolation Patterns

Soft multi-tenancy uses Kubernetes namespaces to separate workloads from teams you trust (like different departments in your company). You rely on:

  • RBAC to prevent cross-namespace access
  • Network Policies to isolate pod communication
  • Resource Quotas to prevent resource exhaustion
  • Pod Security Standards to enforce consistent security baselines

This works when all tenants trust the cluster administrators and accept shared infrastructure risks.

When Namespaces Aren't Enough

Hard multi-tenancy (separate clusters) is necessary when:

  • Tenants have different compliance requirements (PCI-DSS vs. public data)
  • You need absolute blast radius containment (customer A's breach can't touch customer B)
  • Trust boundaries are strict (external customers, regulated industries)
  • Different security postures or admin privileges are required

A single misconfigured admission controller or kernel vulnerability can potentially breach namespace isolation—there's still a shared control plane, node OS, and network.

Hybrid Approaches

Some organizations use cluster-per-environment (dev/staging/prod) or cluster-per-team for high-value workloads, while using namespace isolation within clusters for lower-risk separation.

Key Takeaway: Namespace isolation with RBAC and Network Policies works for trusted internal teams, but separate clusters are essential when strong security boundaries, compliance isolation, or untrusted tenants require guaranteed separation.