Skip to main content

Command Palette

Search for a command to run...

Day 17: Kubernetes architecture

Updated
4 min readView as Markdown
Day 17: Kubernetes architecture
P

Hi, I am an AWS-certified cloud engineer and I write about my progress and learnings of DevOps.

Hello Everyone!

As of now, I'm jumping to Kubernetes from Jenkins due to some technical issues, will definitely come back to that.

Let's dive deep into Kubernetes.

What is Kubernetes? Why do we call it k8s?

Kubernetes is an open-source container orchestration platform that facilitates the deployment, management, and scaling of containerized applications.

Kubernetes is also referred to as K8s The abbreviation K8s is derived by replacing the eight letters of “ubernete” with the digit 8 in Kubernetes.

What are the benefits of using Kubernetes?

When I say K8s is a platform to orchestrate containers, the first question that comes is why we need a platform in the first place when we can run containers using Docker.

When we use containers in production there are various issues that we encounter that can not be solved by just using Docker. Let me mention some of the issues and how we can solve them by using Kubernetes.

  1. Single host: Containers are ephemeral in nature which means they have a short life. Since docker is hosted on a single host, some containers might get killed due to a lack of memory resources.

  2. Auto healing: If something kills the container it will not start again. There are 100s of reasons why your container can go down.

  3. Auto-scaling: Docker does not support auto-scaling.

  4. Docker does not support any enterprise-level support: The application should have firewall support, Load Balancer, API gateways, etc.

Let's see how we can solve these blockers using Kubernetes.

  1. Single host: By default, Kubernetes is a cluster. A Cluster is basically a group of nodes. We create one master node and a worker node. It has multi-node architecture, which means if required Kubernetes would immediately host a container in a different host.

  2. Auto-scaling: Go to the YAML file and edit it to increase from 1 to 10, this is manual. Horizontal pod autoscaling supports automatic auto-scaling that is, if the load increases it will deploy more containers.

  3. Auto healing: Kubernetes either controls or fix the damage. Even before a container goes down Kubernetes starts healing. Whenever Kubernetes gets a signal about some issue in a container it deploys a new container.

  4. Enterprise nature- Kubernetes is an enterprise-level orchestration platform. Docker is independently never used in a production environment.

Explain the architecture of Kubernetes

Kubernetes Cluster mainly consists of Worker Machines called Nodes and a Control Plane. In a cluster, there is at least one worker node. The Kubectl CLI communicates with the Control Plane and Control Plane manages the Worker Nodes.

Kubernetes — Cluster Architecture

As can be seen in the diagram below, Kubernetes has a client-server architecture and has master and worker nodes, with the master being installed on a single Linux system and the nodes on many Linux workstations.

  • Kubelet: Responsible for the creation of the pod and ensures that the pod is always running and if not takes the necessary action.

  • Kube-proxy: Responsible for generating the IP addresses or load balancing (Uses IP tables in Linux m/c)

  • Container runtime: Responsible to run the container.

  • Master node/Control plane

    1. API server- Who will decide on which node pod needs to be created, it is a core component that deals with when multiple users are giving requests. Component which basically exposes your K8s.

    2. Scheduler- Responsible to schedule resources on K8s. API server decides schedules and executes.

    3. etcd- is a key-value store. Helps to restore the cluster

    4. Controller manager- K8s supports auro scaling so it has to have some components like a replica set.

    5. Cloud control manager- K8s can run on the cloud. There is a request to create LB or S3. For this K8s needs to convert this request to work on cloud.

Write the difference between kubectl and kubelets.

kubectl is a command-line tool for managing Kubernetes clusters, while kubelet is an agent running on each node to manage containers on that node based on instructions from the Kubernetes API server.


Thanks for reading ;)

More from this blog

C

Cloud Cognizance

49 posts

Swimmer | Technical Writer | Cloud Engineer

Day 17: Kubernetes architecture