Kubernetes namespaces partition a Kubernetes cluster into logical isolations. This enables IT teams to organize Kubernetes infrastructure resources so that various users and teams can collaborate while maintaining clear and isolated boundaries.
For example, with Kubernetes namespaces, IT teams can logically isolate development, test, and production environments. Namespaces also provide administrative control over resources, via resource quotas and limits.
When an IT admin first sets up a Kubernetes cluster, four namespaces are automatically created:
- Default. All the resource deployments without a namespace are deployed under this namespace.
- kube-system. This namespace holds Kubernetes system configurations and deployments crucial to the Kubernetes cluster.
- kube-public. This namespace is open to all users with read-only access but reserved for system usage.
- kube-node-lease. All nodes have an associated Lease object in this namespace. A Lease boosts the performance of the node heartbeats — messages that nodes send to the node controller to indicate availability — as the Kubernetes cluster scales.
Let’s dig deeper and understand how to work with namespaces. As a prerequisite, have a Kubernetes cluster up and running before attempting the commands.
Query namespaces
Run the following commands to receive the list of all namespaces or a specific namespace in Kubernetes:
kubectl get namespaces kubectl get namespaces <name of namespace>
This will produce an output similar to Figure 1.
For more detailed information about a namespace, use the describe command:
kubectl describe namespaces <name of namespace>
[Read More on TechTarget.com]
Author of “PowerShell Guide to Python“, “Windows Subsystem for Linux (WSL)” and currently writing the most awaited book: “PowerShell to C# and Back” !
Prateek Singh
Related posts
Categories
Author of Books
Awards
Open Sourced Projects
Author at
Blog Roll
Mike F RobbinsDamien Van Robaeys
Stéphane van Gulick
Kevin Marquette
Adam Bertram
Stephanos Constantinou
Francois-Xavier Cat
Ravikanth Chaganti
Roman Levchenko
Blog Stats
- 1,132,982 People Reached