Kubernetes as an orchestration platform for containers is similar to a whole human community or a national state. As in that, every single container is as a citizen in it. Many metaphors are used to explain Kubernetes architecture because it is so complex. However, when we imagine Kubernetes as a nation of containers with all its complexities, Kubernetes seem simpler than human nations and easier to understand.
The idea usually appears in our mind when we hear that Kubernetes is for managing a large number of containers, and it’s just a process of direct presidency above them. This simple idea must facilitate understanding what Kubernetes is for newcomers who newly understood containers and Docker. But you shouldn’t think Kubernetes building is that simple.
What is Kubernetes?
Kubernetes is one of the most modern digital productions of the fourth industrial revolution. It’s an open-source container orchestration tool produced and developed by Google. Its usage is for managing containerized applications and microservices. It distributes them across clusters of nodes.
Kubernetes aims to mitigate the complexity of managing huge amounts of containers by using REST APIs to perform the required functions. It is also very portable naturally and can run on any public or private cloud platform and provider. It also can run in complete function on traditional bare-metal servers.
It is better to think of Kubernetes as the community of people starting from the individual, one container. Then a small group of containers which means family or Pod. Then for a large gathering of families, which means a community or cluster. Kubernetes is like a people’s community. And it also contains different levels and a hierarchy of managing them.
Single container >> Small group of containers or Pod >> Cluster of Pods >> Kubernetes
Indeed, Kubernetes is not just a container orchestrator. It also has some state functions like taking care of containers’ health, recording their names and serial numbers in records, and organizing replication. In addition to scaling up and down of cloud resources. Its goal is to let the microservices and stateless applications development teams focus on workflows and deployment automation.
Kubernetes Main Components
To avoid getting lost in some basic units starting from containers to pods and clusters, the best way to understand Kubernetes easily is to start from the major parts and so on.
Kubernetes follows the client-server architecture model. It makes up a cluster which is two principal parts or nodes:
- Master node(s): it is working as a control and administrator plane for worker nodes and their Pods. You can call it via CLI command or direct API calls. It can exist across multiple machines to secure high availability and to secure some fault tolerance. Sometimes, there is more than one master node for backup and fault-tolerance purposes.
- Worker node(s): this unit containing the containerized application. Each cluster should include one worker node at least. It can be a virtual or physical server. And it hosts the scheduled Pods which is a small co-located group of containers. If you need to access the applications, your goal should be the worker nodes, not the master ones.
Kubernetes Master Node Architecture
Now, it is time for understanding complex parts easily after dividing them. The master node contains some components like the following:
- Kube API server: the central component that receives all REST API calls for adjustments in the cluster’s various needs and has exclusive access to
- Kube controller: a cloud-controller-manager that runs and regulates different background processes such as replications, and its response to status changes.
- Kube scheduler: it schedules the pods on the different nodes according to the resources. And it knows the total resources available.
- DNS server: for Kubernetes services.
- etcd storage: simple key-value storage to store the Kubernetes cluster data like Pods numbers, status, namespace, and more. In addition to API objects. It can’t be accessed except by the API server to keep security.
Kubernetes Worker Node Architecture
The worker nodes in Kubernetes are the main components containing the containerized applications. It consists of the following:
- Kubelet: it is considered the main part of a worker node. Through the Kube-API server, it regularly modified pod specifications. Also, it checks the health and state of pods and containers, and it sends reports to the master node about pods’ status.
- Kube-proxy: a proxy server runs on every worker node to interact with subnets of individual hosts, and it showcases services to the end-user. Also, it regularly forwards requests to the meaned pods and containers using different secured networks across a cluster.
- Kubectl: a CLI to facilitate dealing with Kube-API server by sending shell commands to the master node which convert into API calls.
- Container runtime: the smaller unit that consists of a container engine or software which runs and manages a continuous life cycle of container applications.
Now the remains are some other sparse objects and abstractions that you need to know to understand Kubernetes architecture.
Kubernetes Objects are the following:
- Pod: one or small connected group of containers that encapsulated together with shared storage and network ID.
- Service: it represents a logical set of pods as a gateway to overcoming the problem of the continuous killing of pods.
- Volume: it applies to a whole pod and its containers to guarantee preserving data across container restarts.
- Namespace: some type of virtual cluster aims to serve isolated multiple users and projects. The namespace resources must be exclusive for it and quota allocated.
- Deployment controller: uses a YAML text file to instruct the desired state of pods and replica sets. It can also update the environment to reach the desired state described in the deployment YAML file.
Kubernetes showcases some complexity since it deals with vast workloads and functions. This also makes it hard to understand. This article has seen easy-to-track and digest explanations about Kubernetes architecture. It consists of master nodes that control the worker nodes that host the pods, which are the simple one or small group of connected containers.
Technical and Content Writer interested in writing and documenting about new technologies. You can know more at his website copyingdigital.com.