Kubernetes Basics

Kubernetes Basics

Kubernetes (K8s) is Google's open-source for automating software deployment, scaling, and managing containerised applications (applications that run in isolated runtime environments called containers).

Open source refers to software or projects whose source code is publicly available for anyone to use, inspect, alter, or distribute.
A container is a software package that contains everything required to run an application, including the code and any runtime it requires, application and system libraries, and default values for any critical settings. Containers are a good and easy way to bundle and run your applications.
Example of Containers

The image above shows three containers, with the first container hosting all of the website's frontend files. The second container shows where all of the website's backend files are running. The final container represents a container in which all of the website's database files are executing. Thus, Kubernetes is used to manage all of these containers, ensuring that the web application runs effectively, and maintain communication between containers.

Why Do We Use Kubernetes?

  • In a production environment, you must manage the containers that run the apps, ensuring that there is no downtime (time when the programme is unavailable for use) and very few failures; this is handled by Kubernetes.
  • Kubernetes includes a backup solution that automatically finds all components and backs up the complete application as a unit. Kubernetes restorations and backups are good.
  • Kubernetes is primarily used to manage, scale, and maintain microservices.

Microservices is an architectural method to developing software applications that consists of small, independent, and loosely connected services.

Kubernetes – Architecture

As can be seen in the image below, Kubernetes has a master-worker architecture, with the master being installed on a single system and the nodes on many workstations.

Kubernetes – Architecture

Kubernetes Cluster is composed mostly of Worker Machines known as Nodes and a Control Plane known as Master. A cluster contains at least one worker node.

Kubernetes Cluster

The master server has certain methods for managing worker nodes.

  • The API server is a component of Kubernetes that manages the worker nodes. Kubectl (present in master server) is required to execute the API Server.
  • Kubelet is an agent that is stored in a worker node and manages everything that happens there.
  • When API Server receives a request for Scheduling Pods then the request is passed on to the Scheduler. It intelligently decides on which node to schedule the pod for better efficiency of the cluster.
  • CNI Network is a virtual network layer that allows for communication between clusters as well as between master and worker nodes.
  • The controller-manager is responsible for keeping track of what happens in the cluster.
  • Etcd is a key-value datastore that stores and manages vital information for distributed systems.
  • Service Proxy is the process responsible for forwarding the request to the right pod in the worker node.

Kubernetes doesn't run containers directly; instead it wraps one or more containers into a high-level structure called a pod. In Kubernetes, a pod is the smallest and simplest unit. A Pod always runs on a Node. Any containers in the same pod will share the same resources and local network.
Kubernetes Pod

"OpenLens" may refer to "Lens", an open-source integrated development environment (IDE) for Kubernetes. Lens provides a graphical user interface (GUI) for managing and monitoring Kubernetes clusters.

Open Lens

A Kubernetes Deployment tells Kubernetes how to create or modify instances of the pods that hold a containerized application. Deployments can help to efficiently scale the number of replica pods, enable the rollout (process of updating the configuration of a running application) of updated code in a controlled manner, or rollback (process of reverting a deployment to a previous known-good state) to an earlier deployment version if necessary. Kubernetes deployments are completed using kubectl.

Kubernetes Deployment
A Kubernetes ReplicaSet is a control loop that ensures a specified number of pod replicas are running at any given time. It creates and replaces pods as necessary to maintain the desired state. ReplicaSets ensure that a specified number of identical pod replicas are running at all times. This redundancy enhances the availability of applications by providing failover capabilities. If a pod fails or becomes unresponsive, the ReplicaSet automatically replaces it with a new instance, ensuring continuous operation of the application.




要查看或添加评论,请登录

Yash Chaturvedi ????的更多文章

社区洞察

其他会员也浏览了