Namespace
Kubernetes clusters are large enough to be easily shared between teams or environments, but many teams still want the division of server resources. Namespaces help establish these divisions.
Namespaces
A namespace is a virtual cluster.
A namespace is an optional feature that divides cluster resources between teams or environments.
Namespaces cannot be nested.
A resource can only be in one namespace.
Namespaces are logical separations between systems and are also known as virtual clusters. Namespaces help divide a Kubernetes cluster. Names are unique only within a namespace. The same object names can be used in different namespaces. RBAC and resource quotas can be defined per namespace.
A namespace cannot exist within a namespace—you cannot nest namespaces. A resource that is defined within a namespace cannot be shared with other namespaces.
Namespace Examples
Separate namespaces for production and development environments.
Apply storage resource quotas to the development environment.
Set a computer resources limit in a development environment.
One use case for namespaces is to separate development environments. Production, test, and development environments can all exist in the same cluster. Because names are unique per namespace, the same resources can be tested in each environment simply by changing the namespace. Resource quotas in the test and development environments help ensure that the production environment has the resources it needs.
Each development team has its own namespace.
Each team has permission to manage its own pods, but not pods from other namespaces.
A team does not need its own cluster.
Another example of using namespaces is for development teams. Each development team has their own namespace. Through RBAC, a team would have permission to manage its own pods, but not pods that exist in another namespace. Resource quotas ensure that each team has the resources it needs without affecting other teams.
Last updated