简体   繁体   中英

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

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?

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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM