A node(minion) is a machine, physical or virtual on which Kubernetes is installed. A node is a worker machine that is where containers will be launched by Kubernetes.
What If the node on which your application is running fails?
Obviously, our application goes down. So, you need to have more than one node.
A Cluster is a set of nodes grouped together
This way even if one node fails you have your application still accessible from the other nodes. Moreover, multiple nodes help in sharing the load as well
- Who is responsible for managing the cluster?
- Where is the information about members of the cluster stored?
- How are the nodes monitored?
- When a node fails how do you move the workload of the field node to another worker node?
Thus, The Master is another node with Kubernetes installed in it and is configured as a Master. The master watches over the nodes in the cluster and is responsible for the actual orchestration of containers on the worker nodes.
When you install Kubernetes on a system, you are actually installing the following components. An API Server, and etcd service, a kubelet service, a Container Runtime, Controllers, and Schedulers.
- API Server
- Container Runtime
The API Server acts as the front end for Kubernetes. The users, management devices, command-line interfaces, all talk to the API server to interact with Kubernetes cluster.
etcd is a distributed reliable key value store used by kubernetes to store all data used to manage the cluster. When you have multiple nodes and multiple Masters in your cluster, etcd stores all that information on all the nodes in the cluster in a distributed manner. etcd is responsible for implementing locks within the cluster to ensure that there are no conflicts between the Masters.
The Scheduler is responsible for distributing work or containers across multiple nodes. It looks for newly created containers and assigns them to nodes.
The Controllers are the brain behind orchestration. They are responsible for noticing and responding when nodes, containers or end points goes down. The controllers make decisions to bring up new containers in such cases.
The Container Runtime is the underlying software that is used to run containers in one of the examples is Docker. There are other options as well.
Kubelet is the agent that runs on each node in the cluster. The agent is responsible for making sure that the containers are running on the nodes as expected.
Master vs Worker Nodes
Master and Worker and a set of components that make up Kubernetes. However, how are these components distributed across different types of servers? In other words, how does one server become a master and the other the slave?
The worker node as it is also known is where the containers are hosted. For example, Docker containers to run docker containers on a system, we need container runtime installed and that is where the container runtime falls. In this case, it happens to be Docker. This does not have to be Docker. There are other containers run time alternatives available such as Rocket or Cryo. Mostly, we are going to use Docker as our container runtime engine.
The master node has the kube API server and that is what makes it a master Similarly, the worker nodes have the kubelet agent that is responsible for interacting with a master to provide health information of the worker node and carry out actions requested by the Master on the worker nodes. All the information gathered are stored in a key value store on the master. The key value store is based on the popular etcd. The master also has the control manager and the scheduler.
One of the command line utilities known as the kube command line tool or kubectl. The kubectl tool is used to deploy and manage applications on a Kubernetes cluster. To get cluster information, to get the status of other nodes in the cluster and to manage many other things.
$ kubectl run hello-minikube
- kubetl run command is used to deploy an application on the cluster.
$ kubectl cluster-info
- kubectl cluster-info command is used to view information about the cluster.
$ kubectl get nodes
- kubectl get nodes