Getting Started with Kubernetes: A Beginners Guide

Companies have started embracing the containerized approach. While they all used to have a massive monolithic architecture with thousands of lines of code that grew into a humongous, slow-moving, hard to manage thing, and this is where the problems started.

The DevOps experts, developers, and architects are now coming to the opinion that a microservices architecture is the right approach for DevOps.

The trend started from containerization to microservices to Docker to now; it is Kubernetes time.

Everyone is talking about Kubernetes, hmmm. What makes it so unique and popular? Well, several reasons make it popular among enterprises and developers. Kubernetes is the world’s most popular and has become a defacto tool for container orchestration. It rose to dominance because of its features, the community, offerings in the cloud, etc.

Want to learn how Kubernetes works? Check out this video.

Today, we will discuss why and how Kubernetes came into existence and the architectural aspects.

History of Kubernetes

Google was a fan of containerization from the beginning.

Google started with the Borg, a small scale internal project in 2003-2004. The goal of the project was to provide a tool-set for cluster management at Google. At times, the Borg system used to run thousands of jobs and thousands of applications within Google.

The same infrastructure is also used to deliver the initial version of Google Cloud platform. However, services like Google Compute Engine were found that efficient and what was missing from the puzzle was a great container management system. Sometime in 2014, Google introduced Kubernetes that was an open-source version of Borg. Then the Kubernetes community grew rapidly. Soon, big companies like Microsoft, RedHat, IBM, and Docker became part of this community.

After its open-source release, Kubernetes started competing with many other prominent container-management systems. It started competing with Docker Swarm and Apache Mesos, but we all know, Kubernetes is now the clear winner when compared to any of its competitors.

One of the reasons Kubernetes surged past its competitors is the magic of community and support behind it: Kubernetes is one of the largest open source communities (more than 27,000+ stars on GitHub); It has contributions from thousands of prominent organizations (1,409 contributors); and is part of the open-source foundation, the Cloud Native Computing Foundation (CNCF).

What is Kubernetes?

Docker has completely changed the way software is built and shipped these days; it enables us to create, run, and manage a few containers. While Kubernetes can orchestrate a large number of containers.

It is used to manage and control many containers because when the number of containers grow in numbers, it is hard to manage them just with Docker and is almost impossible.

Originally created by Google, and later donated proudly to the Cloud Native Computing Foundation, Kubernetes is an open-source container orchestration platform that can easily and automatically scale, distribute, and handle faults on containers. Kubernetes is extensively used in production environments to handle Docker containers.

The idea of containerization and Docker containers draw a great attention and many companies started embracing these new technologies. There was a need in the market for such a tool/platform which can handle (control) and automate these containers when the number of containers grew. That is where Kubernetes comes into the play and acquired the market completely.

Kubernetes architecture

Image source: Wikiwand

Kubernetes works on master-slave architecture.

Some Kubernetes master components

  • Kubelet: Kubelet is the principal Kubernetes agent, and it runs on every node in the cluster. It watches and listens for tasks sent from the API Server, then executes the job, and finally reports back to the Master.
  • Kubernetes Master: It is the central control component that distributes and manages the containers on the nodes.
  • Nodes: It is also referred to as a worker machine. It can be a virtual machine (VM) or a physical server. The so called pods run on the nodes.
  • Pods: Pods are the tiniest deployable units in the Kubernetes system. They hold one or more containers that share the allocated resources.
  • etcd: etcd is regarded as the brain of the Kubernetes cluster. It stores the configurations of the Kubernetes cluster and secrets and represents the key-value database. Anything we read from a ‘kubectl get ABC’ command is all stored in etcd.
  • API server: It acts as a main management point of the entire cluster in the system. API server contains all the information of the etcd, that makes it one of the most critical components of Kubernetes. It is also responsible for the authentication and authorization mechanism.
  • kube-scheduler: The kube-scheduler is one of the core components of the system, and it monitors and manages the utilization of the nodes by deciding based on the resources on which node a pod starts.
  • Controller Manager: Acts as a central controller that contains all control mechanisms and is, therefore, an essential component for monitoring. Controller manager watches the replication set, node, endpoints (services), and service accounts. It communicates with the API server to read and write all statuses. Besides all this, it performs tasks such as, event garbage collection, namespace creation, terminated-pod garbage collection, cascading-deletion garbage collection, node garbage collection, etc.

Want to learn more about Kubernetes architecture? Check out this video.

Also read: Kubernetes Architecture Overview for DevOps Enthusiasts

Kubernetes is here to stay as most of the organizations are embracing the DevOps path, and Microservices approach, it becomes a necessity to adopt containerization and hence Kubernetes to manage and execute the digital transformation in all these organizations.

Knowing how Kuberbetes works has become a must required skillset for developers today who like to build their career in DevOps and also, these are the people who are paid heavily in the companies.

If you like to learn Kubernetes, take this ‘Kubernetes for beginners‘ course or ‘Kubernetes from beginner to expert‘ course.