Master Node
- Master nodes has different process running inside than Slave Nodes
- Its task is to:
- Schedule a pod
- monitor
- re-schedule / restart a pod
- join a new Node
- 4 Process that run on every master node
- Api service
- It is like a cluster gateway
- clients (k8s cli etc) communicate with this layer, which then forwards the request to desired node(s)
- It also acts as a "Gatekeeper" for authentication. Such that, non authorized clients cannot access or update/query our nodes!
- For example:
- Any query first calls Api server on master node
- It then validates a request
- and forwards the request to other process
- Scheduler
- Schedule new pod
- example:
- New command, "schedule new pod" is called
- it connects to Api Service which then commincates with scheduler
- Start the application pod on a worker node.
- Intelligently, it will know which node to start the pod in! Magic!
- ❕Scheduler only "decides", which node to schedule a pod in. The "kubelet" inside that "node" is responsible for actually starting that pod.
- Controller Manager
- It detects state changes
- For Example:
- Pod(s) or Node(s) die
- It catches this event and calls "Scheduler" to "schedule" a pod or node
- which in turns calls kubelet inside the selected node(s)
- etcd
- The cluster brain
- key value store
- every change in cluster (state) is saved in etcd. i.e. pod created, died etc etc
- It also holds information about:
- How much resource is available in each resource
- Health of each node / pod
- cluster state changes
Resources distribution between Master & Slave nodes
- CPU, RAM, storage, all of them are available differently between master and slave nodes
- Even though master node is very important, since it acts as the gateway, it also requires the least amount of resources because of that!
- Worker nodes usually get more resources!