Day 30 Task: Kubernetes Architecture Overview

Kubernetes Overview:

Kubernetes is a portable, extensible, open source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available.

The name Kubernetes originates from Greek, meaning helmsman or pilot. K8s as an abbreviation results from counting the eight letters between the "K" and the "s". Google open-sourced the Kubernetes project in 2014. Kubernetes combines over 15 years of Google's experience running production workloads at scale with best-of-breed ideas and practices from the community.

1.What is Kubernetes? Write in your own words and why do we call it k8s?

Kubernetes (also known as k8s or “kube”) is an open source container orchestration platform that automates many of the manual processes involved in deploying, managing, and scaling containerized applications.

k" which is the first letter of Kubernetes, "8" which is the number of letters between the first and the last in the word, and "s" which is the last letter.

2.What are the benefits of using k8s?

Kubernetes has Multi-cloud Capability

It Is Cheaper Than Its Alternatives

Kubernetes Runs Your Applications With Better Stability

Kubernetes Is Open Source And Free

Kubernetes Is Portable And Flexible

Kubernetes Has Benefits of Cloud Native Management Tools For free

Free Availability Of Resources Online

Kubernetes Offers Unmatched Automation

Kubernetes Offers Better Uptime.

3.Explain the architecture of Kubernetes?

The first and foremost thing you should understand about Kubernetes is, it is a distributed system. Meaning, it has multiple components spread across different servers over a network. These servers could be Virtual machines or bare metal servers. We call it a Kubernetes cluster.

Cluster Consists of Control Panel(Master) and Worker Node.

  1. kube-apiserver

  2. etcd

  3. kube-scheduler

  4. kube-controller-manager

  5. cloud-controller-manager

kube-apiserver:

The kube-api server is the central hub of the Kubernetes cluster that exposes the Kubernetes API.

So when you use kubectl to manage the cluster, at the backend you are actually communicating with the API server through HTTP REST APIs. However, the internal cluster components like the scheduler, controller, etc talk to the API server using gRPC.

e.g.Interface between we as a user and IRCTC app as we are accesing through browser,requesting something and we are getting response from server this is what API interface is.

etcd:

In simple words we can say, when you use kubectl to get kubernetes object details, you are getting it from etcd. Also, when you deploy an object like a pod, an entry gets created in etcd.

kube-scheduler

The kube-scheduler is responsible for scheduling pods on worker nodes.

When you deploy a pod, you specify the pod requirements such as CPU, memory, affinity, taints or tolerations, priority, persistent volumes (PV), etc. The scheduler’s primary task is to identify the create request and choose the best node for a pod that satisfies the requirements.

Kube control manager:

It is a component that manages all the Kubernetes controllers. Kubernetes resources/objects like pods, namespaces, jobs, replicaset are managed by respective controllers. Also, the kube scheduler is also a controller managed by Kube controller manager.

Cloud-controller-manager:

When kubernetes is deployed in cloud environments, the cloud controller manager acts as a bridge between Cloud Platform APIs and the Kubernetes cluster.

This way the core kubernetes core components can work independently and allow the cloud providers to integrate with kubernetes using plugins. (For example, an interface between kubernetes cluster and AWS cloud API)

Cloud controller integration allows Kubernetes cluster to provision cloud resources like instances (for nodes), Load Balancers (for services), and Storage Volumes (for persistent volumes).

Kube proxy talks to the API server to get the details about the Service (ClusterIP) and respective pod IPs & ports (endpoints). It also monitors for changes in service and endpoints.

Control plane: The collection of processes that control Kubernetes nodes. This is where all task assignments originate.

The control plane is responsible for container orchestration and maintaining the desired state of the cluster. It has the following components.

Nodes: These machines perform the requested tasks assigned by the control plane.This controller updates node-related information by talking to the cloud provider API. For example, node labeling & annotation, getting hostname, CPU & memory availability, nodes health, etc

Pod: A group of one or more containers deployed to a single node. All containers in a pod share an IP address, IPC, hostname, and other resources. Pods abstract network and storage from the underlying container. This lets you move containers around the cluster more easily.

Replication controller: This controls how many identical copies of a pod should be running somewhere on the cluster.

Service: This decouples work definitions from the pods. Kubernetes service proxies automatically get service requests to the right pod—no matter where it moves in the cluster or even if it’s been replaced.

Kubelet: This service runs on nodes, reads the container manifests, and ensures the defined containers are started and running.Kubelet is an agent component that runs on every node in the cluster. it does not run as a container instead runs as a daemon, managed by systemd.

kubectl: The command line configuration tool for Kubernetes.

4.What is Control Plane?

Control panel: The collection of processes that control Kubernetes nodes. This is where all task assignments originate.

Control panel contains below components.

kube-apiserver

etcd

kube-scheduler

kube-controller-manager

cloud-controller-manage

5.Write the difference between kubectl and kubelets?

kubectl is the command-line interface (CLI) tool for working with a Kubernetes cluster. Kubelet is the technology that applies, creates, updates, and destroys containers on a Kubernetes node. Let’s explore the details.

kubectl is the primary means by which a developer can interact with a Kubernetes cluster. For example, if you want to get the basic information about the nodes in a cluster, you’d type the command.

6.Explain the role of the API server?

An application programming interface is a set of rules that define how computers, applications, or machines can talk to each other. You can think of it this way: the typical user interface is intended for use by a human being, while APIs are intended for use by an application or computer.

Thank you for reading!! Hope you find this helpful.

#day30#90daysofdevops#devopscommunity#

Always open for suggestions..!!