What is Kubernetes? Why do we call it k8s?
Kubernetes is an open-source orchestration tool for containers. It helps in automating software deployment, scaling, and management.
There are 8 characters between 'K' and 's' and that is why it is also called K8S as a short form of Kubernetes.
What are the benefits of using k8s?
Kubernetes Is Open Source And Free
Deploying workloads in multi-cloud environments
Secured
Enhance productivity
Stability
Scalability
Explain the architecture of Kubernetes
The architecture of Kubernetes consists of clusters, a Master node and a Worker node. The "node" can be the virtual or physical machine where Kubernetes is installed.
Master Node
The master node is responsible for the orchestration of the containers on the worker node. It consists of several components as below
API Server:- The API server communicates with all components in the cluster.
etcd:- etcd is used to store all data used to manage the cluster. The Master node queries etcd to retrieve parameters for the state of the nodes, pods, and containers.
Controller:- The role of the Controller is to obtain the desired state of the nodes from the API Server. It checks the current state of the nodes it is tasked to control, determines if there are any differences, and resolves them, if any.
Scheduler:- Is your cluster healthy? If new containers are needed, where will they fit? These are the concerns of the Kubernetes scheduler. The scheduler considers the resource needs of a pod, such as CPU or memory, along with the health of the cluster. Then it schedules the pod to an appropriate compute node.
Worker Node
The worker node is which runs the application using the pods. It is managed by the Master node.
kubelet:- Each worker node contains a kubelet, a tiny application that communicates with the API Server. The kublet monitors the status of running containers and reports to API Server about status, events and resource consumption and carries out the action requested by API Server on the worker node.
Container runtime:- To run the containers, each worker node has a container runtime engine. Docker is one example, but Kubernetes supports other Open Container runtimes as well, such as rkt and CRI-O.
What is Control Plane?
- The control plane manages the worker nodes and the Pods in the cluster. In production environments, the control plane usually runs across multiple computers and a cluster usually runs multiple nodes, providing fault tolerance and high availability.
Write the difference between kubectl and kubelet
- kubectl is the command-line interface (CLI) tool for working with a Kubernetes cluster; whereas, Kubelet is the technology that applies, creates, updates, and destroys containers on a Kubernetes node.
Explain the role of the API server.
- The API (application programming interface) server determines if a request is valid and then processes it. In essence, the API is the interface used to manage, create, and configure Kubernetes clusters. It's how the users, external components, and parts of your cluster all communicate with each other.