DEV Community

technonotes-hacker
technonotes-hacker

Posted on

Kubernetes - A Complete Guide in Tamil - 1

  • helmsman
  • A helmsman is a person who physically steers a ship, boat, sailboat, submarine, airship, or spacecraft.

  • K8s
  • Most popular for managing the container.
  • Open source container orchestration platform.
  • orchestration --> Management of container.
  • Automate --> scale up & scale down , Deployment process.
  • Load Balacing

History

  • Developed by Google - 2014
  • CNCF --> Managing the k8s ( CNCF acquried ).
  • Kubernetes a greek word for helmsman.
  • 7 spokes in k8s represents 7 founders.

Why we need k8s ?

  • To update all the container at a time with docker is a challange or complex process.
  • Container should not go down ( maintaince ).
  • If container fails , it needs to restart by itself.
  • Production Challenges : Manual scaling , HA & Networking along with storage.

K8s

  • All the above will be automated by KUBERNETES.
  • Automating deployment & scaling.
  • Self-healing.
  • LB
  • Managing storage.
  • Its like Swiggy Eg., Order FOOD and just relax . Swiggy will take care everything.

  • To host the application inside the containers.
  • We can't directly work with container , here its called PODS.
  • Pods will run on worker nodes.

Docker Swarm vs K8s

  • Both are event organiser.
  • Docker Swarm contains --> Cluster --> Cluster contains --> Nodes --> Nodes containes --> Containers --> Containers contain APPs.
  • K8s contains --> Cluster --> Cluster contains --> Nodes --> Nodes --> Nodes containes --> PODS --> PODS contain --> Containers contain APPs.

  • Docker Swarm --> Small scale events. Eg., Common wealth
  • K8s --> Large scale events. Eg., Olympics

Cluster

  • Cluster is a group of servers or virtual machine.
  • Any cluster contains
  1. Master Node / Control Plane
  2. Worker Nodes / Data Plane

Control Plane

  • Its like a director
  • Manage the scheduling , scaling & Monitoring.
  • Control Plane is like டைரக்டர் சங்கர். Control Plane எல்லாத்தையும் பாத்துப்பார்.

Worker Nodes / Data Plane

  • Its like actors
  • Follow the instruction of control plane and ensure the task is executed.
  • Each nodes will have containers inside.
  • The actual work will happen inside the worker node.
  • Each node runs containers inside PODS.
  • Worker Nodes is like ACTOR ரஜினிகாந்த் மாதிரி டைரக்டர் என்ன சொல்றாரோ அதை தான் கேட்கணும். Implementation இவர்தான்.

k8s Architecture

  • Each worker node containes:
  1. Kubelet
  2. Kube-Proxy

  • CLI --> Command Line Interphase
  • Kubectl --> With this only we are going to communicate with KUBERNETES.

How deployment Happens in K8s ?

  • You can't interact with WORKER NODE directly.
  • Anything you need to do in K8S means , you need to do with Control plane only.
  • You want to create a POD ? Inside the POD , you want to deploy a Application.
  • Now the user request will go to API Server and the API Server will store the request to etcd.
  • etcd --> Store the request in this and its a internal datasource of K8S.
  • Now Scheduler will always check the etcd , is there any request available.
  • Scheduler found one request that " someone trying to deploy the application ".
  • Scheduler will decide , in which WORKER NODE it needs to deployed.
  • How the Scheduler decides which worker node ? --> Scheduler will have a information of the WORKER NODE. ( storage , pods are running already , CPU ) will be assessed by the scheduler.
  • How Scheduler knows all the details of the worker node ? There will be worker node agent called --> KUBELET.
  • KUBELET role is to gather WORKER NODE information , so its called WORKER NODE AGENT. Which as all the informatio n related to the worker node and send the information to the Scheduler .
  • Scheduler will decide in which worker node it should be scheduled. thats it.
  • Who is the actuall one to deploy ? Controller-Manager.
  • Kube-Proxy is the network interphase between Control plane and worker node and between pods.
  • Kube-Proxy is a Network element of K8S Cluster --> Container Network Interphase --> CNI.
  • CNI is a plugin.
  • CNI will take care
  1. Communication smoothly happens between Worker node and Control plane.
  2. Control Plane and worker nodes.
  3. Pods running in the same container.
  4. Pods which are runninhg in same worker node.
  5. Poda which are running different worker nodes.
  • Inside Woker Nodes , you will have CRI --> Container Runtime Interphase.
  • CRI --> is nothing but --> DOCKER.
  • CRI will help to create the pods and inside the pods , container will be availble.

  • All these will happen in FACTION OF SECS.

Types of K8S Cluster

Self Managed Cluster

  • Minikube --> Single node cluster
  • _Kubeadm _--> Multi Node Cluster --> Manual Maintainence.
  • Kops--> Multi Node Cluster --> Manual Maintainence.
  • KinD --> Multi Node Cluster --> Manual Maintainence. ( Kubernetes in Docker ) --> Kubernetes can also be maintained in Docker.
  • rancher --> Self Managed.

Cloud Managed K8S Cluster

  • AWS --> EKS --> Elastic Kubernetes Service
  • Azure --> AKS --> Azure Kubernetes Service
  • GCP --> Google Kubernetes Engine ( GKE )

Methods of creating Cluster

  • Direct Console
  • CLI --> Command Line Interphase
  • Manifest file --> Configuration file
  • Terraform

Billing of K8S

  • This is only for CLUSTER.
  • Other underlying resources will have separate charges.

AWS

  • EKS Cluster --> Elastic Kubernetes Service
  • Launch a EC2 Instance --> EKS Client VM
  • With this interact with the cluster.

Notes

  • Docker is used to create Container.
  • Docker Swarm is used to manage. Its a part of Docker.

Top comments (0)