Kubernetes | A Basic Understanding | Architecture of K8s

Kubernetes | A Basic Understanding | Architecture of K8s

Table of contents

What is Kubernetes?

  • Container orchestration
  • Features of Kubernetes
  • What is a pod?

Reasons for being famous - K8s

Architecture of Kubernetes

Control plane (master node) components

  • Kube API Server
  • Etcd Server
  • Kube Scheduler
  • Controller Manager

Worker node components

  • Kubelet
  • Kube-proxy
  • Container Runtime

Summarize: What is my understanding?


What is Kubernetes?

Kubernetes is a portable, scalable open source platform to manage and deploy containerized applications, facilitates both declarative configuration and automation.


On my mind, what is container orchestration, then?

Example: I’m running my containarized applications on single docker engine, what if that docker engine fails? All my applications would go down. 


Here, A container orchestration tool helps to provide high availability and scalability on Docker engines or nodes. It achieves this by managing worker nodes through master nodes in a cluster.


Kubernetes orchestrates containers across various runtimes, like Docker, RKT, or CRI, through pods. What are pods? discussed after features of Kubernetes.


Features of Kubernetes:


  1. Scalability: Kubernetes allows you to effortlessly scale your applications up or down based on demand.
  2. Resilience: Kubernetes ensures high availability and reliability of applications. If a node fails, Kubernetes automatically restarts or reschedules the affected components, keeping your application running without interruption.
  3. Automation: Kubernetes automates many tasks involved in managing applications. It handles load balancing, networking, storage, and even rolling out updates or rollbacks, reducing manual intervention and human errors.
  4. Portability: With Kubernetes, you can deploy your applications consistently across different environments, whether it's on-premises, in the cloud, or a hybrid setup. This portability makes it easier to move and manage your applications as needed.
  5. Ecosystem: Kubernetes has a vast ecosystem with a wide range of tools and services built around it. This ecosystem provides additional functionalities and extensions to enhance your application deployment and management.


What is pod?

  • Consider that containers are working inside pods. Pods provide all the computation power, RAM, and required data to run the containers.


  • Should one Pod have only one container? The answer is yes. One Pod: One Container also know as main-container. We do make use of other containers in the same pod, but they are known as sidecars (support containers), used to initiate or provide the resources required to run the main container.


Example 1:

  • In a web application, one pod can have Apache Tomcat as the main container and another pod can have MySQL as the main container.
  • Communication between pods is achieved through IP addresses and ports assigned by the container runtime.


Example 2:

  • In a cluster with 3 worker nodes, let's say each node has 2 pods, each with its own unique IP.
  • The worker nodes are connected inside a pod just like a subnet, which can be extended to other nodes using a bridge if necessary.



Reasons for being famous - K8s

Kubernetes has a big and diverse community:

This is larger and more active compared to its competitors like Apache Mesos and Docker Swarm.


The success can be attributed to Google's approach of allowing the community to drive Kubernetes' development, while other projects have more single-vendor influence.


Kubernetes has deep roots at Google:

Kubernetes has its origins in Google's internal technology called Borg, which was developed and used for over 15 years to manage the infrastructure behind popular Google services.


They aim to enhance developer productivity and create a positive impact on the world by scaling Kubernetes as an open-source solution.


Kubernetes is currently managed by the Cloud Native Computing Foundation (CNCF). In 2015, Google donated the Kubernetes project to the CNCF, but it still has Kubernetes has deep roots at Google.


Architecture of Kubernetes


No alt text provided for this image
Thanks for Visualpath Udemy Imran Teli

The Kubernetes architecture has two main components: the master node (one per cluster) and the worker nodes (one or more per cluster).


The master node is like the central control center that manages and coordinates the entire Kubernetes cluster. It receives requests, schedules workloads, and ensures the cluster's overall health and stability.


On the other hand, the worker nodes are where the actual applications run, executing the assigned tasks. They communicate with the master node, run containers, and manage networking within the cluster.


Control plane (master node) components

Kube API Server:

It acts as the central control point for the cluster. It receives requests from users or other components and then processes and responds to them.


It provides a REST API that enables users to interact with the cluster and manage its resources.


API Server is the primary interface for interacting with the cluster and is the front end of the Kubernetes control plane.



Etcd server:

It is a distributed key-value store that stores the cluster's configuration data and state.


It helps maintain consistency and provides reliable storage for the cluster's information. Stores the current state of everything in the cluster.



Kube Scheduler: 

It assigns workloads or tasks to the worker nodes based on resource availability, constraints, and other factors.


The scheduler makes sure that the workloads are distributed efficiently across the cluster.



Controller Manager:

It manages different controllers that handle cluster operations. 

Node controller: Tracks worker node status and handles changes/failures.

Replication controller: Maintains desired pod replicas.

Endpoints: Updates endpoint objects.

Service Account and Token Controller: Creates default accounts and API tokens for namespaces.



Worker node components

Kubelet:

It is an agent that runs on each worker node and communicates with the master node.


The kubelet ensures that containers are running as intended on the node, based on the instructions received from the master node


Container Runtime: 


It is responsible for running and managing containers on the worker nodes. Kubernetes supports various container runtimes, such as Docker, containerd, and CRI-O.



The container runtime is responsible for creating the containers and setting up their networking and storage resources, as well as monitoring their health and resource usage.


kube-proxy:

It handles network communications between different services or pods running on the worker nodes.


It manages the network routing, load balancing, and firewall rules to enable communication within the cluster.



Summarize: What is my understanding?

Containers have been in use for a long time, but managing microservices with them posed challenges in terms of scalability, high availability, automation, portability, and management. To address these issues, Google introduced Kubernetes, that they had developed to manage their own containerized services.

Later Kubernetes converted as an open source gained popularity due to its strong infrastructure and the added advantage of a supportive community. It simplified the management of containers, making them easily disposable while providing the desired features.


 



In the above blog, I explained the architecture of Kubernetes and highlighted the need for Kubernetes and the issues it resolves.


Let's connect and have a conversation. If you have any questions or would like to share your experiences, I encourage you to leave a comment below or reach out to me. Your feedback could be helpful for me in improving the blog, so please don't hesitate to reach out with any suggestions or corrections.


#day1 #devops #kubernetes

Ashutosh Maske

Devops-IT-Ops @ colpari GMBH, Germany | Ex-Accenture

2w

Amazing !! Good for revision

Like
Reply

To view or add a comment, sign in

More articles by Rakesh Nagarajan

  • Your Resume Might Be the Problem… Fix This! 🚀

    Almost every company now uses ATS (Applicant Tracking Systems) to filter resumes before HR even sees them. That means…

  • Minikube: kubernetes

    Before we begin, let understand some basic concepts of minikube. What is Minikube? Minikube is a lightweight solution…

  • Back to Basics - Git and GitHub

    Git is a popular version control system VCS that is commonly used to track the versions of a repository or directory…

  • AWS - Virtual Private Cloud (VPC)

    #awscloud #vpc #amazonwebservices #devopscommunity #devopstools A couple of years ago, I was wondering about the need…

    2 Comments

Insights from the community

Others also viewed

Explore topics