Can a worker node in kubernetes can run two different pods?

1/15/2021

In kubernetes we can pods on worker nodes and pods share the resources and IP address,but what if we run two diiferent pods on a same worker node does that mean that both the pods will have different IP address?

-- Rishabh Jain
kubernetes

1 Answer

1/15/2021

To answer the main question - yes. A node can and does run different pods. Even if you have only one Deployment you can run kubectl describe nodes my-node Or even kubectl get pods --all-namespaces
To see some pods that kubernetes uses for its control plane on each node.

About the second question, it really depends on your deployment, id recommend on reading about kube proxy which is a pod running on every node! (Regarding your first question) and is in charge of the networking layer and communication within the cluster https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/

The pods will have their own IP address within that node, and there are ways to directly communicate with pods

https://superuser.openstack.org/articles/review-of-pod-to-pod-communications-in-kubernetes/

https://kubernetes.io/docs/concepts/cluster-administration/networking/

-- CloudBalancing
Source: StackOverflow