Description
Use separate namespaces when teams or services have different owners or permissions. A shared namespace such as shared-all can work for workloads managed together.
Potential impact
A permission granted to one team in a shared namespace can extend to another team’s resources.
Remediation
Configure RBAC, ResourceQuota and supported NetworkPolicies in the destination namespaces. After moving workloads, check Secret and Service references and test the connections they need.
Examples
Create frontend-team and billing-team first and supply your application images.
Before
yaml
apiVersion: v1
kind: Pod
metadata:
name: frontend
namespace: shared-all
spec:
containers:
- name: app
image: example/frontend:v1
---
apiVersion: v1
kind: Pod
metadata:
name: billing
namespace: shared-all
spec:
containers:
- name: app
image: example/billing:v1
After
yaml
apiVersion: v1
kind: Pod
metadata:
name: frontend
namespace: frontend-team
spec:
containers:
- name: app
image: example/frontend:v1
---
apiVersion: v1
kind: Pod
metadata:
name: billing
namespace: billing-team
spec:
containers:
- name: app
image: example/billing:v1