Table of Contents
Table of Contents
Further Reading
How namespaces work
Each namespace provides a scoped space for naming and managing resources. Two namespaces can each hold a service with the same name without conflict.
Namespaces matter most in clusters shared by many teams or environments, where isolation and governance are key.
- Scoped names: resource names must be unique only within a namespace
- Access control: RBAC roles grant permissions per namespace
- Quotas: CPU, memory, and storage limits apply per namespace
- Default namespaces: clusters start with default, kube-system, and kube-public
Namespace vs. cluster
Both create boundaries. They differ in how strong those boundaries are.
Why namespaces matter in Kubernetes
Namespaces are foundational for organizing and scaling workloads. Without them, large clusters become disorganized, and resources become hard to track.
- Isolation: separate workloads by project, team, or environment
- No naming collisions: identical resource names across namespaces
- Simpler access control: RBAC defines who can view or change resources
- Resource quotas: limits stop one team from using everything
- Multi-tenancy: many teams share one cluster safely
- Automation: pipelines and test tools target environments dynamically
Consider a SaaS company with ten teams on one cluster. Namespaces give each team its own space, quota, and permissions without the cost of ten clusters.
Common challenges with namespaces
- Configuration drift: definitions differ between namespaces over time
- Cross-namespace traffic: extra networking and DNS setup is often needed
- Visibility silos: metrics, logs, and tests spread across namespaces
- RBAC complexity: fine-grained policies for many namespaces are error-prone
- Automation gaps: pipelines must know which namespace to target
Strong governance and consistent naming prevent namespace sprawl.
How namespaces relate to Testkube
Testkube uses Kubernetes namespaces to organize and isolate testing inside clusters. Testing stays aligned with native namespace management.
- Scoped runs: each test execution or workflow can target a specific namespace
- Access control: teams manage their tests without affecting others
- Per-namespace settings: distinct secrets, configuration, and storage
- Multi-environment runs: identical tests in dev, staging, or production namespaces
- Easy cleanup: test resources removed per namespace
- CI/CD targeting: pipelines choose the namespace for each run
Real-world examples
- Separated test types: a QA team runs smoke tests in qa-tests and load tests in load-tests
- Staging gates: a DevOps engineer runs CI/CD-triggered Testkube tests in staging before promotion
- Team ownership: a multi-tenant organization gives each team its own namespace
- Quota control: a platform team caps test resources with namespace quotas
- Compliance: a regulated enterprise runs validation tests in restricted namespaces



