Kubernetes Architecture: How It Works
It is the basic control unit which controls workloads and communication in the system. Each of its mechanisms has a dissimilar process which can run on a single master node or on different master nodes.
Its components are:
Etcd Storage: It is an open-source key-value data store developed by CoreOS team and can be accessed by all nodes in the cluster. The use of “Etcd” is to store configuration data of the cluster to symbolize the overall state of the cluster anytime.
API-Server: The API server is the essential management process that receives REST requests for changes, serving as a front-end to manage the cluster. Furthermore, this is the only thing that connects with Etcd cluster, ensuring that data is stored in Etcd.
Scheduler: It is helpful to schedule the pods on different nodes based on resource consumption and decides where to deploy which service. The schedule has the data regarding the resources available to the individuals as well as the one which is left for organizing the service to run.
Controller Manager: It runs various distinct controller methods in the background to order the shared state of the cluster and doing a routine task. When there is any modification in the service, the controller identifies the change and begin working towards the new desired state.
This is also recognized as a Kubernetes or Minion node, and it includes the information to manage communication between containers such as Docker and network between the master node as assigning the resources to the containers as per schedule
Kubelet: Kubelet ensures that all containers in the node are running and are in a healthy state. Kubelet organizes the state of a pod if it is not in the anticipated state. If a node miscarries, a replication controller detects this change and launches pods on another healthy pod.
Container: Containers are the lowest level of microservices, placed inside the pod and needs the external IP address to view the outside process.
Kube Proxy: It works as a network proxy and a load balancer. Moreover, it forwards the request to the accurate pods in the isolated networks in a cluster.
cAdvisor: Works as an assistant who is responsible for controlling and gathering data about resource usage and performance metrics on every node.
Advantages of Kubernetes are mentioned below:
Portable and Open-Source
Kubernetes are able to run containers on one or more public cloud, virtual machine, or on bare metal which means it can be implemented on any infrastructure. Additionally, it is compatible across different platforms, creating multi-cloud strategy highly flexible and usable as well.
Kubernetes offers several useful features for scaling purpose:
- Horizontal Infrastructure Scaling: Operations are finished at the specific server level to execute horizontal scaling. New servers can be added or removed easily.
- Auto-Scaling: Based on the usage of CPU assets or other application-metrics, you can change the number of containers that are working.
- Manual Scaling: You may manually scale the number of working containers through a command or the interface.
- Replication Controller: The repetition controller ensures that the cluster has a particular number of equivalent pods in a working condition. If there are too many pods, the replication controller can remove extra pods or vice-versa.
Kubernetes are able to handle the availability of both applications and infrastructure. It tackles:
- Health Checks: Kubernetes ensure that the application does not fail by continually checking the health of modes and containers. Kubernetes offers self-healing and auto replacement if a pod crashes due to an error.
- Traffic Routing and Load Balancing: Kubernetes load balancer distributes the load across multiple loads, enabling you to balance the resources quickly during incidental traffic or batch processing.
Designed for Deployment:
Containerization has an ability to speed up the process of building, testing, and releasing software, and the useful feature includes:
Automated Rollouts and Rollbacks: Kubernetes handles the new version and updates for your app without downtime, while also monitoring the health during roll-out. If any disappointment happens during the process, it automatically rolls back.
Canary Deployments: It tests the production of new deployment and the past version in parallel, i.e. before scaling up the new implementation and parallelly scaling down the past deployment.
Programming Language and Framework Support: Kubernetes supports most of the programming languages and frameworks like Java, .NET, etc., and has also got great support from the development community. If an application has the capacity to perform in a container, it can run in Kubernetes as well.
Some More Things to Look for: Kubernetes provides DNS management, resource monitoring, logging, storage orchestration and also addresses security as one of the primary things. For instance, it makes sure that information like passwords or ssh keys are stored securely in Kubernetes secrets. New functionalities are released continually and can be on the Kubernetes GitHub.