Home > front end >  kubernetes: Is POD is also like a PC
kubernetes: Is POD is also like a PC

Time:03-09

I see that kubernets uses pod and then in each pod there can be multiple containers.

Example I create a pod with

Container 1: Django server - running at port 8000
Container 2: Reactjs server - running at port 3000

Whereas

I am coming for docker background

So in docker we do

docker run --name django -d -p 8000:8000 some-django
docker run --name reactjs -d -p 3000:3000 some-reactjs

So POD is also like PC with some ubunut os on it

CodePudding user response:

No, a Pod is not like a PC/VM with Ubuntu on it.

There is no intermediate layer between your host and the containers in a pod. The only thing happening here is that the containers in a pod share some resources/namespaces in the host's kernel, and there are mechanisms in your host kernel to "protect" the containers from seeing other containers. Pods are just a mechanism to help you deploy a couple containers that share some resources (like the network namespace) a little easier. Fundamentally they are just linux processes directly on the host.

(one nuanced technicality/caveat on the above statement: Docker and tools like it will sometimes run their own VM and may try to make that invisible to you. For example, Docker Desktop does this. Usually you can ignore this layer, but it is great to know it is there. The answer holds though: That one single VM will host all of your pods/containers and there is not one VM per pod.)

  • Related