Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes node-node communication

Tags:

kubernetes

I'm trying to understand the Kubernetes design on how/if worker nodes communicate with each other. I found documentation on the node-master communication but nothing on node-node. I've understood that pods can communicate even if they are on different nodes unless a NetworkPolicy prevents this. What I'm wondering is if the information flow in the master-slave architecture is strictly between worker node and master or also between worker nodes.

Question 1: Do worker nodes communicate with each other or does that only occur between pods? Or rather, do the nodes communicate even if their pods do not?

Question 2: Say we have 2 worker nodes and that we have ssh:ed into one of the nodes, what information would be available about the other node or the master?

Thanks!

like image 772
Christian Abdelmassih Avatar asked Oct 16 '22 21:10

Christian Abdelmassih


2 Answers

Do worker nodes communicate with each other or does that only occur between pods? Or rather, do the nodes communicate even if their pods do not?

A worker node represents a collection of a few processes: kubelet, kube-proxy, and a container runtime (docker or rkt). If by communicate you are referring to sharing node state, health etc. as in a P2P system then no.

Pods communicate with pods (or services) and nodes are also able to reach pod and service ip addresses (this routing is handled by kube-proxy using iptables) and overlay networking.

However, in practice kubernetes relies on distributed KV store etcd for keeping system critical information. etcd may be deployed on the same nodes as the worker processes which requires node to node communication.

Say we have 2 worker nodes and that we have ssh:ed into one of the nodes, what information would be available about the other node or the master?

There is no information kept about the other worker node or master node.
You could glean some information from the kubelet config files or see connection activity to the master node (apiserver component specifically) in the kubelet logs.


In general, the master node(s) run an apiserver pod which is the access point to the kubernetes cluster state (stored in etcd). Pods, kubectl, etc. use the apiserver to get information as required.

like image 196
stacksonstacks Avatar answered Oct 21 '22 22:10

stacksonstacks


I documented before that two pods within the same node can communicate directly.

But between nodes, you need to go through a router/gateway, using a kube-proxy and a net filter.
See much more in "how is cluster IP in kubernetes-aws configured?".

In both cases, the master is not involved or referenced explicitly.

like image 1
VonC Avatar answered Oct 21 '22 20:10

VonC