More Info:
Verifies the default namespace has no workloads so RBAC, quotas and NetworkPolicies can be scoped per tenant.Risk Level
MediumAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
List all workloads in the
defaultnamespace (run on any machine with kubectl access): -
For each workload type in
default, export its manifests to files so you can recreate them in a new namespace (replace WORKLOAD and NAME accordingly; run on any machine with kubectl access): -
Edit each exported manifest file to set a purpose-specific namespace and remove default-assigned fields (run on any machine with kubectl access):
- In each YAML file, under
metadata, set: - Remove the following fields if present to avoid conflicts when recreating:
metadata: { uid, resourceVersion, selfLink, creationTimestamp, managedFields, ownerReferences }statussections
- Save the edited files.
- In each YAML file, under
-
Create the new namespace if it does not already exist (run on any machine with kubectl access):
-
Recreate workloads in the new namespace, then delete them from
default(run on any machine with kubectl access): -
Verification (run on any machine with kubectl access):
Confirm that
podCount=0andis_compliant=true.
Using kubectl
Using kubectl
On any machine with kubectl access:Repeat this export–edit–apply–delete process for every workload that currently runs in the
- Identify all workloads in the
defaultnamespace
- For each workload type, export its manifest from
defaultand save it to a file, then edit the namespace field.
my-app:- Create the target namespace if it does not already exist:
- Apply the updated manifest into the new namespace:
- Once you have recreated all needed workloads in their new, purpose-specific namespaces and confirmed they are running correctly, delete the originals from the
defaultnamespace.
default namespace, moving each into an appropriate purpose-specific namespace.- Verification (pod count in
defaultshould be zero):
Automation
Automation

