Kubernetes Architecture.

Photo by Louis Reed on Unsplash

Kubernetes is a container orchestration tool from google and it is the most popular container orchestration tool currently which is provided by most of the cloud service provided as well. There are some more such as Docker Swam, Nomad, OpenShift. It is important to understand the Kubernetes architecture to understand the underline functionalities of it.

There are two kind of terminologies that you need to understand before deep dive to k8s architecture which are nodes and cluster.

  • Node — It is a physical or virtual machine where we deploy our pods. (In k8s we define our deployments as pods. pods and containers are not same). There are two types of nodes which are master nodes and worker node. All the controlling part is done in the master node which is the brain and actual work is done in the worker node which is the muscle.

Kubernetes architecture contains following main components

  • Api server

Let’s simplify the k8s architecture using an example. There is a company called ABC and in this company there is a mother company which handles all the operations and there are two factories called Q and P as follows.

There are 5 employees in the mother company (Master Node) naming Asoke(api server), Eric(cluster store), Shikar(Schedular), Collin(Controller manager), Chiran(Cloud controller manager) and there are two operation factories(worker nodes) caller P and Q.

Let’s ask one by one about their roles.

  • Asoke(Api-server) handles all the incoming request to the mother company and pass it to the relevant employee. All the internal commination happen through Asoke.

Hope this example make sense up to some extends. Kubernetes is like a collection of factories which is mentioned above. Each component in the k8s have its own task.

Let’s go to full explanation.

Api server

  • Api server is the main interface which communicate to the outside world. If we want to do a deployment we need to call api server.

Cluster store

  • Cluster store stores all the data related to the cluster(nodes, deployments, services etc) and etcd is used to store these data.
  • etcd is a distributed key value store.

Schedular

  • Schedular allocate our deployments in the relevant node.
  • As given in the above example when the schedular gets a deployment it will check nodes resource availability which is in the cluster store and decide which node to use for the next deployment.

Controller manager

  • This will watch all the desired deployments and current deployments with the help of cluster store. If there is any mismatch controller manager will inform the schedular to do the deployment.

Cloud controller manager

  • This will check the deployments in the cloud service providers such as google, amazon or azure which does the same task as controller manager.

Kubelet

  • Kubelet is the main agent in every worker node and it will act as the Api server for the worker node as well.

Container runtime

  • Container runtime is responsible of pulling imagers from container registries such as docker hub, ACR, GCR and run those.

K-Proxy

  • K-proxy responsible for local networking and communication between pods through the load balancer.

In the next post we will talk about pods and how to do a deployment.

If you have found this helpful please hit that 👏 and share it on social media :)

Technical Writer | Tech Enthusiast | Open source contributor