Multi-tenant SaaS Platforms — Cells, Rings & Progressive Delivery›Tenants: isolation and onboarding · Cheat sheet & self-check

Tenants: isolation and onboarding · wrap-up

Cheat sheet & self-check

Every command from this section on one page.

11 · Tenancy models: silo, pool and bridge

The three models

SiloDedicated resources per tenant: strongest isolation, highest cost, N copies to run
PoolShared resources, rows and requests carry a tenant ID: cheapest, isolation is logical
BridgePool for most layers or tenants, silo where it matters: the usual real answer

Decide per layer

Edge / gatewayAlmost always pooled, with per-tenant limits
ComputePooled per cell; dedicated node pool or cell for heavy tenants
DataShared tables + row-level security, schema per tenant, or database per tenant
Encryption keysOften per tenant even when data is pooled
Whole stackDedicated cell for regulated or very large tenants

12 · Isolating tenant data

PostgreSQL row-level security

ALTER TABLE t ENABLE ROW LEVEL SECURITYTurn RLS on: without a policy, non-owners see nothing
CREATE POLICY p ON t USING (...) WITH CHECK (...)USING filters rows you can see/change; WITH CHECK validates rows you write
current_setting('app.tenant_id', true)Read the tenant set for this transaction; true = return NULL if unset
SET LOCAL app.tenant_id = 'acme'Set the tenant for this transaction only (safe with connection pools)
ALTER TABLE t FORCE ROW LEVEL SECURITYApply policies to the table owner too
rolsuper / rolbypassrlsThese roles skip RLS: never let the application use them

Isolation options for data

Shared tables + tenant_id + RLSCheapest, scales to many tenants; isolation enforced in the database
Schema per tenantClear separation; migrations run per schema; fine up to thousands
Database per tenantStrongest short of a dedicated cell; per-tenant backup/restore; costly at scale
Per-tenant keyEncrypt tenant data with its own key; delete the key to make data unreadable

13 · Teams on a shared Kubernetes cluster

Verify a tenant

kubectl auth can-i create deployments -n team-a --as=jane@example.com --as-group=team-a-devsTest what a group member may do (needs impersonation rights)
kubectl auth can-i delete networkpolicies -n team-a --as=jane@example.com --as-group=team-a-devsMust be no: the team can't remove its own isolation
kubectl describe quota -n team-aUsed vs hard limits
kubectl get events -n team-a --field-selector reason=FailedCreatePods blocked by quota or Pod Security
kubectl get ns team-a --show-labelsPod Security level and tenant labels
kubectl label --dry-run=server --overwrite ns team-a pod-security.kubernetes.io/enforce=restrictedWhat would break before you enforce Pod Security

The pieces

Namespace + pod-security.kubernetes.io/enforce=restrictedBoundary; no root, no privileged pods, no host access
RoleBinding: Group → ClusterRole tenant-developer / viewWho can do what, managed in the identity provider; not the built-in edit role
ResourceQuotaTotal CPU, memory, pods, storage, LoadBalancers for the namespace
LimitRangeDefault requests/limits and a per-container maximum
NetworkPolicy default deny + allow DNSOther namespaces can't reach the team's pods

Dedicated nodes (hard isolation)

kubectl taint node N1 N2 platform.example.com/tenant=team-a:NoExecuteRepel and evict every pod without the toleration
kubectl label node N1 N2 platform.example.com/tenant=team-aLet the team's pods select these nodes
MutatingAdmissionPolicy (GA in 1.36)Writes nodeSelector and toleration into the team's pods
ValidatingAdmissionPolicy (GA in 1.30)Rejects other tenants' tolerations, wildcard tolerations and spec.nodeName
kubectl tenants describe team-aAccess, quota left and blocked workloads for one tenant (tenant-insights)

14 · Automating tenant onboarding

Levels of automation

1. Tenant chartOne platform-owned Helm chart; a tenant = small values file; quotas from tiers
2. GitOpsApplicationSet: one Argo CD Application per tenant file; delete the file to offboard
3. Self-servicePortal form or PR → CI validation → auto-merge for small tiers, approval for large
4. GuardrailsPolicy engine generates and protects defaults in every tenant namespace

Commands

helm lint charts/tenant -f tenants/team-b.yamlCheck the chart with one tenant's values
helm template team-b charts/tenant -f tenants/team-b.yamlRender what Argo CD would apply
kubectl get applications -n argocd -l platform.example.com/kind=tenantTenant applications and their sync status

15 · Customer tenant lifecycle

Onboarding steps

1. RecordTenant ID, plan, home region, status provisioning
2. PlacementA cell in the home region with capacity, or a new dedicated cell
3. Data and keysRows or schema in the cell's database; per-tenant key
4. IdentityOrganization in the platform IdP; SSO with the customer's IdP; first admin; optional SCIM
5. LimitsPlan limits loaded: API rate, users, storage, jobs
6. RoutingTenant → cell entry; per-tenant hostname if used
7. MeteringUsage events and billing start
8. VerifySmoke test as the tenant, then status active

Workflow rules

Idempotent stepsCreate-if-missing; safe to run twice
CompensationUndo finished steps in reverse order if the workflow can't complete
Visible statusprovisioning → active / failed (with reason) → suspended → offboarded