Hey Learners! Welcome back. Till the time we learned about Linux, shell scripting, Git-GitHub, Docker, Docker-Compose, Jenkins, etc. Now it's time to take our learning to the next level with Kubernetes. Let's start.....
Kubernetes Overview
With the widespread adoption of containers among organizations, Kubernetes, the container-centric management software, has become a standard for deploying and operating containerized applications and is one of the most important parts of DevOps.
Originally developed at Google and released as open-source in 2014. Kubernetes builds on 15 years of running Google's containerized workloads and the valuable contributions from the open-source community. Inspired by Google’s internal cluster management system.
Tasks
1- What is Kubernetes? Write in your own words and why do we call it k8s?
Kubernetes is an open-source container orchestration tool that automates deploying, scaling, and managing applications on a group of servers(cluster).
Kubernetes was developed by a Google lab and later donated to CNCF(Cloud Native Computing Foundation).
The number 8 represents the number of letters skipped between the letters "K" and "S" in Kubernetes.
2) What are the benefits of using K8s?
The benefits of using K8s:-
Container Orchestration- apps run with minimal downtime
Deploying workload in multi-cloud environments
Automation of deployment and scalability
Increased DevOps efficiency for microservices architecture
Less chance of vendor lock-in
Open-source
3) Explain the architecture of Kubernetes
K8s is an architecture that offers a loosely coupled mechanism for service discovery across a cluster. A K8s cluster has one or more Control Planes and one or more Nodes.
Control Plane:- Responsible for managing the overall cluster, exposing the application program Interface(API), and scheduling the initiation and shutdown of nodes based on desired configuration.
Nodes:- Runs a container runtime like Docker along with an agent(Kublet) which communicates with the control plane.
A K8s control plane is the control for a K8s cluster. Its Components include:-
kube-apiserver:- It exposes the K8s API, which is communications central. External communication via command line interface(CLI) or another user interface (UI) passes to the kube-apiserver and all control planes to node communication also go through the API server.
etcd:- The key-value store where all data relating to the cluster is stored. Information in etcd is generally formatted in human-readable YAML.
kube-scheduler:- When a new pod is created, this component assigns it to a node for execution based on resource requirements, policies, and 'affinity' specifications regarding geolocation and interference with other workloads.
kube-controller-manager:- Although a K8s cluster has several controller functions, they are all compiled into a single binary known as kube-controller-manager. Makes sure that the actual state of the cluster matches with desired state.
kubectl:- It is a CLI tool for working with a K8s cluster. It communicates with the API server to perform various operations on the cluster, such as deploying applications, scaling resources, and inspecting logs. It is a primary by which developers can interact with the K8s cluster.
Nodes are the machines, either VMs or physical servers, where K8s place Pods to execute. Node components include:-
kubelet:- Every node has an agent called kubelet. It ensures that the container described in PodSpecs is up and running properly.
kube-proxy:- A network proxy on each node machine that maintains network nodes which allows for the communication from Pods to network session, whether inside or outside the cluster, using
container runtime:- software responsible for running the containerized applications. Although Docker is the most popular, K8s support any runtime that adheres to the K8s CRI(Container Runtime Interface).
4) What is Control Plane?
The control plane is responsible for managing the overall K8s cluster, exposing the application program interface(API), and scheduling the initiation and shutdown of compute nodes on a desired configuration.
5) Write the difference between kubectl and kubelet.
kubectl It is a CLI tool for working with a K8s cluster. It communicates with the API server to perform various operations on the cluster, such as deploying applications, scaling resources, and inspecting logs. whereas, kubelet is the technology that applies, creates, updates, and destroys containers on a K8s node.
6) Explain the role of the API server.
Whenever developers interact with the K8s cluster using kubectl CLI, they communicate with the master API Server component.
The apiserver is the main management of the entire cluster. It processes REST operations, validates them, and updates the corresponding objects in etcd. The apiserver is responsible for the authentication and authorization mechanism. All API clients should be authenticated to interact with the API server.
This is all about K8's introduction and architecture.
Thank you so much for taking the time to read till the end! Hope you found this blog informative.
Feel free to explore more of my content, and don't hesitate to reach out if need any assistance from me or in case of you have any questions.
Find me on:- Hashnode LinkedIn Github
Happy Learning!