More Info:
Namespaces provide administrative and security boundaries for segregating cluster resources. Objects should be organized into dedicated namespaces rather than sharing a single namespace.Risk Level
LowAddress
SecurityCompliance Standards
- CIS GKE
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Inventory current namespaces and workloads
Run on any machine with kubectl access:Review which namespaces exist, which are system/managed (e.g.,kube-system,gke-system,istio-system,gatekeeper-system), and where your application workloads currently run. -
Identify workloads running in inappropriate or shared namespaces
Focus ondefault,kube-system, and any “catch‑all” namespaces:Decide which applications, environments (dev/test/prod), or teams are mixed together and should be separated (e.g., multiple apps sharingdefault, non-system apps inkube-system). -
Design a namespace structure aligned to admin and security boundaries
On a planning machine (no commands):- Define namespaces per application, per environment, or per tenant/team (e.g.,
app1-prod,app1-dev,payments-prod,analytics-dev). - Decide which namespaces require stronger controls (e.g., separate namespace for internet-facing workloads, sensitive data, or admin tooling).
Document the desired namespace layout and which workloads should live where.
- Define namespaces per application, per environment, or per tenant/team (e.g.,
-
Create or update namespace definitions
Run on any machine with kubectl access:- To create missing namespaces:
- Or define them declaratively in a manifest file (example):
Apply with:
- To create missing namespaces:
-
Relocate workloads into the appropriate namespaces
For each workload that should move (Deployments, Services, Jobs, etc.):- Export its manifest and edit the
metadata.namespace(and any namespace-qualified references such as ConfigMaps, Secrets, ServiceAccounts):Editmy-app.yamlto set: - Delete the old object and recreate it in the new namespace (ensure you understand the downtime impact):
- Export its manifest and edit the
-
Verify namespace boundaries are in place
Run on any machine with kubectl access:Confirm that:- Application workloads are no longer concentrated in
defaultor mixed with system components. - Workloads are organized according to the designed boundaries (per app/environment/team) and system namespaces contain only system components.
- Application workloads are no longer concentrated in
Using kubectl
Using kubectl
- Potential problems if:
- Almost all workloads are in
default,kube-system, orkube-public. - Many namespaces exist but have no clear purpose or labels (e.g., missing
env=,team=,app=style labels). - System namespaces (
kube-system,kube-public,kube-node-lease,gke-*) are used for custom application workloads.
- Almost all workloads are in
- Potential problems if:
- Most
Deployment,StatefulSet,DaemonSet,Job, orPodobjects are in a single shared namespace likedefault. - Unrelated applications or teams share the same namespace with no separation.
- Most
- Potential problems if:
- You see many unrelated applications (by name) co-located in the same namespace.
- There is no visible pattern (e.g., per-team, per-environment, or per-application grouping).
- Potential problems if:
- The namespace lacks labels that indicate ownership, environment, or purpose.
- The namespace mixes “shared” or “misc” workloads with no clear boundary.
- Potential problems if:
- User workloads appear in system namespaces (names beginning with
kube-orgke-). - There is no clear distinction between system and application namespaces.
- User workloads appear in system namespaces (names beginning with
- Potential problems if:
- Multiple teams (
TEAMlabel) or environments (ENVlabel) share the same namespace. - No labels are present to show who owns resources or what boundary they belong to.
- Multiple teams (
- You likely fail the intent of CISGKE 4.6.1 if:
- Most or all application workloads run in
default. - Different applications, teams, or environments are not separated into distinct namespaces.
- System and application workloads are mixed in the same namespaces.
- Most or all application workloads run in
- A healthy pattern usually shows:
- Dedicated namespaces per application, team, or environment.
- System namespaces used only for system components.
Automation
Automation
- Many user workloads listed under
=== Objects in the 'default' Namespace ===. - Namespaces listed under:
=== Namespaces with Mixed 'types' of Workloads (heuristic) ====== Namespaces with Both System and Application-Looking Objects ===
- Namespaces listed under
=== Namespaces with No Clear Labeling for Ownership/Boundary ===in a multi-tenant or complex environment.

