0

I've got a basic query on master-worker nodes service routing

I had gone through several posts but I was unable to find out the answer

Lets assume the following setup

10.10.10.32   - Master Node (only-one master node)
10.10.10.1    - Worker Node #1
10.10.10.2    - Worker Node #2

nginx conf

upstream example {
    server 10.10.10.1:30001;  #worker-node1
    server 10.10.10.2:30001;  #worker-node2
}

server {
   server_name domainname.com

   location / {
       proxy_pass http://example
   }
}

When I hit domainname.com request would be sent to upstream and response would be received by client

If I understand correctly, in the event of 'master node failure' we would still be able to reach 'upstream servers' and response would be received by client EDIT

Question #1

why not we schedule the pods as 'static pods'?

if requests were able to reach upstream server even in case of 'master node failure'

Note: I understand static-pods are maintained by kubelet and cannot be reached through control plane

Question #2

Isn't there any relation to master-node when service was hit with respect to the setup mentioned above ?

or in other words

Are master nodes just needed to control scheduling, maintaining replicasets etc. and not when service was hit?

Sathish Kumar
  • 2,150
  • 10
  • 29
  • 51
  • Similar question here: https://stackoverflow.com/questions/39172131/what-happens-when-the-kubernetes-master-fails – blacktide Apr 13 '22 at 14:08
  • FWIW, I just shut down the master nodes on my homelab k3s cluster with etcd and the applications no longer respond (with 6 worker nodes still up). – blacktide Apr 13 '22 at 14:08
  • @blacktide Thanks for your quick response. However, I already gone through that link and does not exactly answer my question. The configuration what I mentioned above is a simulation of my production environment hence I added the words w.r.t setup mentioned above – Sathish Kumar Apr 13 '22 at 14:14
  • `why not we schedule the pods as 'static pods'?` ---**you can create a static pod when the master is down.** . you can use `critctl pods` to list the pod in the work node when master is down, once its up the static pod will be also visible in `kubectl get pod` – P.... Apr 13 '22 at 14:17
  • @P.... Edited my post for better clarity. We were able to hit the service even when master was down few weeks before. I am trying to understand the real role of master node with respect to services – Sathish Kumar Apr 13 '22 at 14:23
  • I do not think there should be any impact here. Networking is managed by CNI plugin and their pod status on each node. If they are up, proxying and services should work fine. Since you asked this question here, are you facing any failure ? – P.... Apr 13 '22 at 14:44
  • @P.... I did not any face any failure. I would like to get answer for question#2 – Sathish Kumar Apr 15 '22 at 05:59
  • @SathishKumar see my last comment. But i am not certain, so put it as comment. – P.... Apr 15 '22 at 21:24

1 Answers1

0

We were able to hit the service even when master was down few weeks before

Any pods that were running on a worker node will still be running when the master node fails, but will not be able to be modified until a master node is brought back online. They might still be reachable, depending on your Ingress setup.

The master nodes do two things: serve the API that takes incoming requests, and write the current state of the cluster to the etcd database.

One node is always elected the “leader” using the RAFT consensus protocol. You need an odd number of voters to prevent a voting tie. So if one of the TWO master nodes fails, the cluster will become headless. 3 master nodes are the minimum needed. Or go with one node and backup etcd rigorously. Here is a helpful link

tdensmore
  • 667
  • 1
  • 6
  • 19