jamiehannaford / what-happens-when-k8s

🤔 What happens when I type kubectl run?

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to determine to which etcd host the kubernetes apiserver is talking to?

venkatalolla opened this issue · comments

Let's say we have 3 Master nodes with an external load balancer and 3 etcd's that are co-located in the same host with etcd running on Master1 node as leader. As you mentioned The resource will be saved to etcd by delegating to the storage provider.

In the following scenario, is there a way to determine to which etcd host the Kubernetes apiserver is talking to?

  1. When a kubectl command is executed, the external load balancer routes the traffic to one of the 3 Master nodes in a round-robin way.
  2. Assume that the HTTP request hits the Master3 node.
  3. The question here is, does the kubernetes-apiserver on Master3 node talks to the leader etcd (on Master1 node) to notify about the resource state and then the leader etcd distributes the data with the other two followers?
    (or)
  4. Does the kubernetes-apiserver on Master3 node talks to the etcd running on Master3 node about the resource state to store and notifies the etcd leader?

The line from kubeernetes-apiserver.service file --etcd-servers=https://10.240.0.10:2379,https://10.240.0.11:2379,https://10.240.0.12:2379 seems like every kubenetes-apiserver running on all 3 Master nodes know about all 3 etcd servers.