Kubernetes is an open-source platform used alongside Docker to deploy, maintain, and implement container applications. A container application is an application that has all its packages, files, and necessary libraries required to run efficiently on various platforms.
Kubernetes was first released in 2014 to make applications run on the cloud.
It controls the hosting and launching of a server and is used to automate different manual processes.
It monitors the health of containers and nodes.
It handles the security of the container, storage services, and networking.
It gives an added storage system to execute apps.
Rollback changes can be automated in it if something goes wrong.
There are differences between Docker and Kubernetes:
Kubernetes can be extensively customized according to the needs of the user, whereas Docker is less flexible in terms of the same.
Kubernetes requires a big bulky setup, whereas it’s easy to set up in Docker.
The fault tolerance of Kubernetes is high as compared to Docker.
Balancing load is manual in the case of Kubernetes while it’s automatic for Docker.
Let’s see what hardware and software are needed for Kubernetes, then move on to its architecture.
Nodes: A node is any small hardware or one machine in a cluster of Kubernetes. It can either be an actual machine or a machine that is on any cloud platform.
Cluster: Kubernetes doesn’t contain individual nodes, rather, it works as a collection of nodes called clusters. The cluster shifts the work as per the requirement if the nodes are removed or added.
Persistent volume: A persistent volume is used for storing the data permanently.
Container: Self-contained environments to execute the programs are called containers. Programs are contained in one file and are shared over a network. Different programs can be collected in a single container with the restriction that a single process can be executed per container.
Pods: Pods consist of more than one application container as a group and are scalable. Replicas of pods are deployed automatically if any pod fails. Pods have two types of resources that are shared, one storage and the other networking. Kubernetes doesn’t manage containers directly, rather it manages the pods.
Deployment: Pods are managed by a layer of abstraction called deployment. It indicates the number of pods running parallely.
Let’s move onto the architecture of Kubernetes:
Master: It is the main unit that controls and manages Kubernetes communication and workload across different clusters.
Master has different components that take care of respective processes.
ETCD: It is responsible for storing the values and details of configuration. It is used for communication among other components and works to perform actions.
Controller Manager: It handles most of the controllers and performs tasks. It runs in a rigorous loop and collects and sends information to the main API server.
Scheduler: It distributes the workload and is the main component of the master node. It takes care of the number of resources available and which resource is allocated to which node.
API Server: It is used as a central manager that handles all the REST requests for changes. It makes sure that various libraries and tools communicate efficiently.
Slave: Components of slave nodes are the following:
Pod: It has storage resources, containers, network id, and various configurations in an encapsulated form.
Docker: It handles that the application runs in a lightweight isolated environment. It also takes care of running the container from images of Docker.
Kubelet: It handles JSON format specifications of the pod and keeps a check that the pod is running properly.
Kubernetes Proxy: The nodes that are in the cluster run in the proxy network, so the Kube proxy moves the request to the specific containers in a node. It creates new containers, balances load, manages pods, etc.
Replication Controllers: A replication controller can be defined as an object that describes a pod template. It controls variables to scale exact replicas of the pod.
Replication Sets: Are an interconnection on the controller design with pliability in the way the controller identifies the pods. It replaces the replication controller due to its high replicate capability.
Deployments: Deployment is a workload in which replication sets can be used as building blocks that put on an attribute of life cycle management.
Stateful Sets: Are a special pod control that offers uniqueness and ordering. Its purpose is to gain control that one has a specific need related to deployment order, persistent data, and stable networking.
The time of deployment gets reduced to seconds.
The delivery and performance are fast.
Portability is improved.
The updates can be deployed as and when required.
Kubernetes security is inefficient.
It is expensive and can be a little complex for simple applications.