Multi Tenant Namespace Isolation
Answer
Scenario
Two teams share a cluster and require strict isolation with specific exceptions for inter-team communication.
Task
Configure network isolation and resource constraints for both teams:
- Create default deny NetworkPolicies for both namespaces (deny all ingress and egress traffic)
- Create a NetworkPolicy allowing
team-apods to accessteam-bpods labeledapp=apion port8080only - Create LimitRanges in both namespaces to enforce maximum resource limits per container
| Property | Value |
|---|---|
| Namespace 1 | team-a |
| Namespace 2 | team-b |
| Allowed communication | team-a → team-b pods with label app=api on port 8080 only |
| Default traffic | Deny all other cross-namespace traffic |
| Max CPU per container | 1 |
| Max Memory per container | 512Mi |
Note: Test pods are already deployed - client in team-a, and api + web in team-b.