What is Kubernetes?

Any developer can package up applications and deploy them on Kubernetes with basic Docker knowledge.

Why Kubernetes?

Traditional deployment era:

Early on, organizations ran applications on physical servers. There was no way to define resource boundaries for applications in a physical server, and this caused resource allocation issues. For example, if multiple applications run on a physical server, there can be instances where one application would take up most of the resources, and as a result, the other applications would underperform. A solution for this would be to run each application on a different physical server. But this did not scale as resources were underutilized, and it was expensive for organizations to maintain many physical servers.

Virtualized deployment era:

As a solution, virtualization was introduced. It allows you to run multiple Virtual Machines (VMs) on a single physical server’s CPU. Virtualization allows applications to be isolated between VMs and provides a level of security as the information of one application cannot be freely accessed by another application.

Virtualization allows better utilization of resources in a physical server and allows better scalability because an application can be added or updated easily, reduces hardware costs, and much more.

Each VM is a full machine running all the components, including its own operating system, on top of the virtualized hardware.

Container deployment era:

Containers are similar to VMs, but they have relaxed isolation properties to share the Operating System (OS) among the applications. Therefore, containers are considered lightweight. Similar to a VM, a container has its own filesystem, CPU, memory, process space, and more. As they are decoupled from the underlying infrastructure, they are portable across clouds and OS distributions.

Containers are becoming popular because they have many benefits. Some of the container benefits are listed below:

What is K8s made up of?

alt text

Kubernetes Cluster is primarily made up of following components

Kubernetes Cluster Components

Master Node and its Components:

alt text

[node1 install]$ kubectl get componentstatus
NAME                 STATUS    MESSAGE             ERROR
scheduler            Healthy   ok
controller-manager   Healthy   ok
etcd-0               Healthy   {"health":"true"}

The Kube API Server

Kubernetes architecture consists of one or more master machine.

The Kube API server is the main component and everything in kubernetes cluster will connect and talk to this API Server. Component on the master that exposes the Kubernetes API. It is the front-end for the Kubernetes control plane.It is designed to scale horizontally – that is, it scales by deploying more instances.

The etcd

Kube Scheduler

Kube-controller-manager

Cloud-controller-manager

Worker Node and its components:

alt text

KubeProxy

Kubelet

alt text

Container Runtime

Kubernetes Constructs:

Kubectl:

alt text

Kubernetes Pod:

alt text

ReplicaSet

Deployment:

alt text

alt text

alt text

ConfigMap

Secret:

Service:

alt text

ClusterIP:

Node Port:

Load Balancer:

Credits: