#90daysdevopschallenge
#day30
What is Kubernetes? Write in your own words and why do we call it k8s?
Kubernetes is a container orchestration, an open-source tool for automating the deployment, scaling, and management of containerized applications.
It was developed by Google as the Brog project but it was donated to the CNCF (Cloud Native Computing Foundation) in 2015.
Kubernetes can help you deliver and manage containerized, legacy, and cloud-native apps, as well as those being refactored into microservices.
K8S is the abbreviation of Kubernetes. In Kubernetes, we have 10 letters, so Start With K and End With S, In between that 8 Letter is present. it's called K8S.
What are the benefits of using k8s?
a) Open Source and Free: K8S is an open-source and free container orchestration tool that operates with the support of an extensive community.
b) Portable and Flexible: K8S can work with almost every runtime and it also works with different infrastructures, be it on-premises, public cloud, or private cloud.
c) Scalability: K8S provides the facility to scale up and scale down the cluster as per the requirement.
d) Rollout and Rollback: K8S provides the feature to deploy a new version of the application without facing any downtime and if required to go back to the previous version of the application, a rollback feature is also available.
e) Self-healing: K8S provides the feature of self-healing. It makes sure that the desired state is preserved at all times. If a container breaks down, it can quickly create its replacement. If a server breaks down, it can detect and recreate the lost containers on a new, working server.
Explain the architecture of Kubernetes.
In the architecture of K8S, we have the Control-Plane node and a Worker Node.
Control-Plane Node: The control plane node is also called the master node. It is responsible for all the activities which are performed on the K8S cluster. The Control Plane node is a collection of four Components:
a) kube-apiserver
b) Kube-scheduler
c) etcd
d) kube-controller-manager
kube-apiserver: kube-apiserver is the front end of the Kubernetes cluster. For every request, the user interacts with the kube-apiserver. It works like the gatekeeper of an organization, without taking entry with kube-apiserver, no request goes inside the cluster, and for every request kube-apiserver firstly validates that request and then moves forward as per the requirement to other components. In the Kubernetes cluster, every component firstly interacts with the kube-apiserver.
Kube-scheduler: The Kube-scheduler is a component of the control plane node. Whenever the kube-apiserver receives the request to schedule a pod on the node, It passes it to the kube-scheduler, and then the kube-scheduler schedules the pod on the particular node for better efficiency of the cluster.
etcd: It is the key-value store of the cluster and component of the control-plane node. every data related to cluster stored in etcd. Etcd behaves like a cluster brain because it tells the scheduler and other processes about the cluster state changes.
whenever kube-apiserver gets the request like for checking pods, or deployments. kube-apiserver firstly checks in the etcd store, if the information is available there, it directly provides it to the end user otherwise it creates a new pod and provides the user and informs kube-scheduler to schedule the pod on any node.
kube-controller-manager: kube-controller-manager is responsible for running the controllers that handle various aspects of cluster control loops. In the Kubernetes Cluster, Multiple controller is present.
Node-Controller is responsible for managing the nodes and also ensures nodes are correctly marked as a ready or non-ready state based on their current state of the cluster.
The Replication Controller is responsible for managing the replicas, it always ensures that the desired number of replicas of a given application is running.
Worker- Node: Worker nodes, are the nodes where actual operations are performed. On these nodes, multiple pods are running. On every worker node, there are three components present.
a) kubelet
b) kube-proxy
c) CRI (Container runtime)
kubelete: kubelete interacts with both the container runtime and node, It is responsible for starting the pod with a container inside.
kube-proxy: It is the process responsible for forwarding the request from Services to the pods. It has intelligent logic to forward the request to the right pod in the worker node.
CRI (Container Runtime): Container runtime is used to run the application container on the pods like docker, and Containerd.
What is a Control Plane?
The Control Plane is a master node in K8S architecture, which is responsible for managing the worker node. It has four components
a) kube-apiserver
b) etcd
c) kube-controller-manager
d) kube-scheduler
Write the difference between kubectl and kubelets.
kubectl: kubectl is a command line tool in Kubernetes, that is used to interact with the Kubernetes cluster through CLI.
kubelet: Kubelet is an agent, present on every worker node. It always makes sure containers are running inside the pod. It is a Kubernetes mechanism to create the container in the worker node.
Explain the role of the API server.
kube-apiserver is a component of the control-plane node or master node. By using kube-apiserver end user interacts with the Kubernetes cluster. In the Kubernetes cluster, kube-apiserver behaves like a gatekeeper, every request first goes to kube-apiserver then after validation, it is forwarded to the required component.
In the Kubernetes cluster, every component interacts with the kube-apiserver.
In the Next Article, we will go deep down in K8S.......
Thank you for giving your precious time to read this blog/article and if any suggestions or improvements are required on my blogs feel free to connect on LinkedIn Unnati Gupta. Happy Learning !!!