Skip to main content

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

Low

Address

Security

Compliance Standards

  • CIS GKE

Triage and Remediation

Remediation

Manual Steps

  1. 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.
  2. Identify workloads running in inappropriate or shared namespaces
    Focus on default, 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 sharing default, non-system apps in kube-system).
  3. 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.
  4. 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:
  5. 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):
      Edit my-app.yaml to set:
    • Delete the old object and recreate it in the new namespace (ensure you understand the downtime impact):
    Repeat for Services, ConfigMaps, Secrets, etc., ensuring all required dependencies exist in the target namespace.
  6. Verify namespace boundaries are in place
    Run on any machine with kubectl access:
    Confirm that:
    • Application workloads are no longer concentrated in default or mixed with system components.
    • Workloads are organized according to the designed boundaries (per app/environment/team) and system namespaces contain only system components.
Review guidance:
  • Potential problems if:
    • Almost all workloads are in default, kube-system, or kube-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.
Review guidance:
  • Potential problems if:
    • Most Deployment, StatefulSet, DaemonSet, Job, or Pod objects are in a single shared namespace like default.
    • Unrelated applications or teams share the same namespace with no separation.
Review guidance:
  • 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).
Review guidance:
  • Potential problems if:
    • The namespace lacks labels that indicate ownership, environment, or purpose.
    • The namespace mixes “shared” or “misc” workloads with no clear boundary.
Review guidance:
  • Potential problems if:
    • User workloads appear in system namespaces (names beginning with kube- or gke-).
    • There is no clear distinction between system and application namespaces.
Review guidance:
  • Potential problems if:
    • Multiple teams (TEAM label) or environments (ENV label) share the same namespace.
    • No labels are present to show who owns resources or what boundary they belong to.
Interpreting issues for this control:
  • 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.
  • A healthy pattern usually shows:
    • Dedicated namespaces per application, team, or environment.
    • System namespaces used only for system components.
What output indicates a problem (to be manually reviewed):
  • 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.