Getting the existing namespaces
The default Namespace
The kube-public Namespace
The kube-system Namespace
Try it yourself
Now that we know that our cluster has multiple Namespaces, let’s explore them a bit.
Getting the existing namespaces
We can list all the Namespaces through the kubectl get namespaces command. As with the most of the other Kubernetes objects and resources, we can also use a shortcut ns instead of the full name.
1
kubectl get ns
Get Namespaces in cluster
The output is as follows.
12345
NAME STATUS AGE
default Active 23m
kube-node-lease Active 23m
kube-public Active 23m
kube-system Active 23m
Output of 'kubectl get ns'
We can see that three Namespaces were set up automatically when we created the cluster.