More Info:
Namespaces provide administrative and access-control boundaries between groups of resources. Create namespaces to segregate resources and place new resources in a specific namespace.Risk Level
LowAddress
SecurityCompliance Standards
- CIS OKE
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Inventory current namespaces and their workloads
Run on any machine with kubectl access:Review whether business-critical applications, shared infrastructure, and testing workloads are clearly separated into different namespaces instead of usingdefault. -
Identify workloads in the
defaultnamespace or other catch‑all namespacesIf you have any custom workloads indefault(or a single large shared namespace), decide how they should be grouped (e.g., by application, environment such as dev/stage/prod, or team/tenant). -
Design the namespace model and create required namespaces
Decide and document which namespaces you need (for example:app1-prod,app1-dev,shared-infra,team-a,team-b).
Create them: -
Plan and apply resource re-homing into the new namespaces
For each workload currently indefault(or another overly broad namespace), export and adjust its manifests:Editmy-deployment.yamlto set:Then re-apply in the target namespace and delete the old resource if needed:Repeat for Services, ConfigMaps, Secrets, Jobs, etc., as appropriate, verifying dependencies (e.g., Service selectors, config references). -
Align access control and policies with the new namespaces
For each new namespace, ensure RBAC and policies match the intended boundary:Create or adjustRole,RoleBinding,NetworkPolicy,ResourceQuota, andLimitRangeobjects so that teams/apps can only access their own namespaces and appropriate resource limits are enforced. -
Verify namespace-based separation is in effect
Confirm that application workloads now reside in their intended namespaces and thatdefaultcontains no (or only minimal/expected) workloads:Review that resources are grouped according to your designed boundaries and that cross-namespace access (via RBAC and policies) matches your administrative intent.
Using kubectl
Using kubectl
- Potential problem if you see only the default/system namespaces (
default,kube-system,kube-public,kube-node-lease, any cloud-provider system namespaces) and no application- or team-specific namespaces. - Also a problem if there is a single custom namespace that appears to host all workloads, suggesting no meaningful separation.
- Potential problem if most or all non-system workloads are in the
defaultnamespace. - Potential problem if unrelated applications (different teams, environments, or sensitivity levels) all run in the same namespace.
- Look for patterns like:
- All
Deploymentsindefault. - Shared namespaces mixing dev/test/prod or internal/external workloads.
- All
- This suggests missing administrative boundaries.
- If access control is mostly via
ClusterRoleBindingto wide roles (e.g.,cluster-admin) and there are few or no namespace-scopedRole/RoleBindingobjects, namespaces are likely not being used as effective boundaries. - If a single namespace’s roles grant broad access to many unrelated resources, it may indicate poor separation.
- If the vast majority of non-system pods are in the
defaultnamespace (or a single shared namespace), administrative boundaries are likely inadequate.
- You should see multiple, clearly named namespaces (e.g., per environment, team, or application).
- Non-system workloads should be spread across those namespaces in a way that matches your intended administrative and access-control boundaries.
Automation
Automation
- Many application Pods/Deployments/Services appear in the
defaultnamespace (section 4and summarysection 7), especially if used by multiple teams or environments. - Critical, unrelated applications share the same namespace (check
section 2and3for “crowded” namespaces mixing different systems or teams). - Broad ClusterRoles and ClusterRoleBindings in
section 5show many subjects (users, groups, service accounts) bound to powerful roles, effectively bypassing namespace isolation. - Namespaces with workloads but few or no Roles/RoleBindings (
section 6) may lack fine-grained, namespace-scoped RBAC.
- Create additional namespaces to separate teams, environments (dev/test/prod), or applications.
- Move workloads out of
defaultinto specific namespaces. - Tighten RBAC so access is appropriately constrained per namespace.

