Kubernetes 101: Architecture

Kubernetes 101: Basic Concepts

Node: a node is a machine, physical or virtual on which kubernetes is installed. A node is a worker machine and that is where containers will be launched by kubernetes. It was also known as minions in the past. But what if the node on which your application is running fails? Obviously your application goes down/fails.So you will need to have more than one node. Note: not the minions below:

Cluster: 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. Also having multiple nodes helps in sharing 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 failed node to another worker node? This is where the master comes in.

Master: 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’re actually installing the following components: An API server, etcd service, a kubelet service, a container runtime, controllers and schedulers. The API server acts a s the front end for kubernetes. The users, management devices, command line interfaces all talk to the API server to interact with the Kubernetes cluster.

Etcd is a distributed reliable key value store by Kubernetes to store all data 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.

Scheduler: the scheduler is responsible for distributing work or containers across multiple nodes.It looks for newly created containers and assigns them to nodes.

Controller: the controllers are the brain behind orchestration. They are responsible for noticing and responding when nodes, containers or end points go down. They make decisions to bring up new containers in such a case.

Container Runtime: The container runtime is the underlying software that is used to run containers .i.e Docker.

Kubelet: Is the agent that runs on each node on the cluster, the agent is responsible for making sure that the containers are running on the nodes as expected.

Above states we have dealt with two servers: Master and Worker and a set of components that make up Kubernetes. How are these components distributed across different types of servers? Or How does one server become a master and the other the slave? The worker node or minion is where the containers are hosted,i.e. To run Docker containers on a system, you will need container runtime installed and that’s where the container runtime falls in this case happens to be Docker.There are other container runtime alternatives available.

The master server has the kube API server and that is what makes it a master. 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 is stored in a key value store on the master, the key value store is based on the popular etcd framework. THe master also has the control manager and the Scheduler plus other components as well.

Kubectl command line

This is one of the command line utilities known as the kube command line tool or kube control. 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.

The kubectl run command is used to deploy an application on the cluster, the kubectl cluster info command is used to view information about the cluster and the kubectl get nodes command is used to list all the nodes part of the cluster.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Fredrick Sachita

Fredrick Sachita

12 Followers

Associate Solutions Architect at SADA|Google Cloud Certified: x4| Microsoft Azure Certified: x4| OCI Certified: x4| AWS Certified: x1