Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does a kubernetes namespace represents in cluster?

Tags:

kubernetes

What is the physical representation of a namespace in cluster (I am using AWS) is it an EC2 server?

Can someone help me understand by giving a metaphor of what is the physical representation of:

  1. Cluster
  2. Namespace
  3. Pods
  4. Containers
like image 488
Vishrant Avatar asked Oct 23 '25 20:10

Vishrant


2 Answers

Let's think of namespace as linux file system and ignore the fact of mounted directories for the sake of this question:

/srv => namespace-1
/var => namespace-2
/mnt => namespace-3
/bin => namespace-4
  • All these 4 directories belongs to same /
  • Inside a directory, you can have different type of files
  • If you do ls /srv you won't see files in /var
  • Different users can have different type of permissions on each directory

Now let's apply above 4 points in from the view of k8s namespace

  • All these 4 namespaces belongs to same kubernetes cluster
  • Inside a namespace, you can have different type of kubernetes objects
  • If you do kubectl get deployments from namespace-1, you won't see deployments in namespace-2
  • Different users can have different type of authorization on each namespaces
like image 168
Suku Avatar answered Oct 26 '25 17:10

Suku


The short answer is - there is no physical representation of a namespace.

A namespace is a high-level abstraction that logically groups and manages Kubernetes resources (for example by type of environment development/staging/production). This helps in separating resources in the way that a resource from one namespace does not have access to the resources in other namespaces.

A cluster is a group of machines.

A container represents a real docker container running in one of the cluster nodes. You could assume a virtual image running inside a physical machine.

A pod represents group of containers (usualy 1 container, but can be more in case of sidecar deployment) deployed from single deployment resource (Deployment, ReplicaSet etc).

like image 26
Alik Khilazhev Avatar answered Oct 26 '25 18:10

Alik Khilazhev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!