Namespace
What is Namespace?
Namespace: A virtual cluster inside a cluster. Groups resources, scopes names, and is the boundary for quotas and RBAC. A Kubernetes namespace is a virtual section of a cluster. Resources in different namespaces can have the same names, and you can apply permissions, resource quotas and network policies per namespace. Common uses are separating environments, such as staging and production, separating applications, or giving each team its own space. Kubernetes itself uses kube-system for its own components.
Frequently asked questions about Namespace
What should you keep in mind with Namespace?
Most kubectl commands work on the current namespace, which makes mistakes easy. Running a delete in production when you thought you were in staging is a classic. Set the namespace explicitly with -n, or use a tool like kubens and a shell prompt that shows the current context and namespace. For strong isolation between untrusted workloads, separate clusters are safer than namespaces alone.
What does an example of Namespace look like?
kubectl create namespace staging kubectl get pods -n staging At a glance
| Category | Kubernetes |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |