Kubernetes Basics
Yash Chaturvedi ????
Software Engineer at Wealthy | FinTech | Tech Enthusiast | Backend Developer | B.Tech CSE '23 | Exploring New Opportunities ??
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.
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?
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 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.
领英推荐
The master server has certain methods for managing worker nodes.
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.
"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.
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.
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.