Kubernetes namespace Information

  • Namespaces are a way to organize clusters into virtual sub-clusters
  • They can be helpful when different teams or projects share a Kubernetes cluster
  • Any number of namespaces are supported within a cluster, each logically separated from others but with the ability to communicate with each other. 
  • Namespaces cannot be nested within each other.

  • Any resource that exists within Kubernetes exists either in the default namespace or a namespace that is created by the cluster operator
  • Only nodes and persistent storage volumes exist outside of the namespace; these low-level resources are always visible to every namespace in the cluster.

What is the “default” namespace in Kubernetes?

Kubernetes comes with three namespaces out-of-the-box. They are:

  1. default: As its name implies, this is the namespace that is referenced by default for every Kubernetes command, and where every Kubernetes resource is located by default. Until new namespaces are created, the entire cluster resides in ‘default’.
  2. kube-system: Used for Kubernetes components and should be avoided.
  3. kube-public: Used for public resources. Not recommended for use by users.

Namespace can be used on

  • deployment
  • pods
  • service
  • configmap
  • secrets

  • List of namespace
kubectl get namespace
  • Create namespace

Leave a Comment