![Forrest logo](/images/logo.png)
kubectl-get:tldr:8f97f
The command "kubectl get namespaces" is used to retrieve the list of namespaces in a Kubernetes cluster.
In Kubernetes, namespaces are used to create virtual clusters within a physical cluster. They are primarily used to organize and isolate resources within a cluster. By default, Kubernetes provides three namespaces: "default", "kube-system", and "kube-public".
When you run the "kubectl get namespaces" command, it communicates with the Kubernetes API server to fetch the list of namespaces and displays the output. The output typically includes the name of each namespace and additional details like the status and creation time.
This command is helpful to understand the existing namespaces in a Kubernetes cluster and to verify if a specific namespace that you are interested in exists or not.