Have you ever operated your sites through kubernetes?

If you haven't yet, then this article would be a good start for you. Now, look at the below section and grasp the basic introduction about kubernetes.  


1. Overview Of Kubernetes

Kubernetes is an open-source system automating application deployment, scaling, and management. It was originally designed by Google and is also recognized as K8s. The developers mainly utilize this tool to manage the containers across the public, private cloud environment. With the private cloud environment, we meant that cloud deployment is where you maintain your own servers and infrastructure that mainly hosts your applications and the data as well.

Kubernetes allows you to deliver a platform-as-a-service or we can say PaaS (Platform as a Service (PaaS) or Application Platform as a Service (PaaS) or platform-based service which is a category of cloud computing services that provides a platform allowing customers to develop, run, and manage applications without the complexity of building and maintaining the infrastructure, along with the self-service platform.

Using kubernetes in your websites reduces many of the manual processes mainly involved in deploying and in the scaling process with the containerized applications.

The containerized application is an OS-level virtualization method used to deploy and run distributed applications without launching an entire virtual machine (VM) for each app.  

After attaining the gist of kubernetes, you might be thinking when kubernetes came into the world of management system or when kubernetes has been launched. In the following section, we are going to show you the history of Kubernetes.  

History Of Kubernetes

Kubernetes holds superiority in the field of management and became one of the most prevalent developments and deployment platforms, earning respect based on merit. Kubernetes was launched around five years ago or we can say in the year of 2015 (June). Although it was started 15 years years ago by google but caught by the developer's sight in 2015. Essentially it was designed by Google and nowadays it is maintained by the Cloud Native computing foundation.

2. Why Use Kubernetes?

As we have discussed, kubernetes is an open-source system which mainly allows you to run containers, manage and operate your own clusters. The engine of Kubernetes isn't only for stateless applications either, you can easily attach persistent storage and even run a proper database in your cluster. Kubernetes provides wide latitude for the types of applications like Gmail and Youtube supported.

We believe that if the site runs in the containers, it should be run in Kubernetes. K8S can run anywhere on bare metal (Bare-metal cloud is a public cloud service in which the customer rents hardware resources from a remote service provider) or in any cloud provider infrastructure.

Features Of Kubernetes

There are some of the features which k8s offers are:

  • Container grouping using pod
  • Self-healing
  • Auto-scalability
  • DNS management
  • Load balancing
  • Rolling update or rollbac


Advantages Of Kubernetes

  • It scales resources and application in real-time.
  • Control & automate deployment and other updates.
  • Orchestrate containers on multiple hosts.
  • Test and auto correction of applications.
  • Features automated internal load balancing through any node in the cluster.
  • K8s solve the port allocation issue of docker, in k8s, the developer can run the number of services at a single port.
  • It performs quite faster.
  • It continually checks the status of container, pods and services.
  • Handles micro-services and hybrid applications.
  • Secures the data in the form of volume (even after the failure of the container)
  • Also handles the traffic with the help of creating replicas.

Disadvantages Of Kubernetes

  • It requires a greats access to the Internet
  • The cloud platform is paid
  • It ain’t a user-friendly platform
  • A developer must aware of the common commands for using kubernetes
  • If we using kubernetes in the local platform, in that case, it’s unable to catch the expected visualization as compare to working over the cloud platform.  

3. Architecture Of Kubernetes

The architecture of Kubernetes provides a flexible, loosely-coupled mechanism for service discovery. Like most distributed computing platforms, a Kubernetes cluster consists of at least one master and multiple compute nodes. The master is responsible for exposing the application program interface (API), scheduling the deployments and managing the overall cluster. Each node runs a container runtime, such as Docker or rkt, along with an agent that communicates with the master.

Kubernetes provides a platform to the developer and allows to configure, automate and manage intelligent and balanced scheduling of the containers. Kubernets says to automate the creation, deletion, and movement of the containers. The scaling process of such containers is easy in kubernetes. It provides monitoring and self-healing abilities.

The Components Of Kubernetes

There are a few components that mainly help to understand how kubernetes is actually worked.

1) Kubernetes - Master Components

The Kubernetes master runs the Scheduler, Controller Manager, API Server, and etcd components and is responsible for managing the Kubernetes cluster. Essentially, it’s the brain of the cluster! Now, let’s dive into each master component.

Master components can be run on any machine in the cluster. If we talk about the master, then this is the Kubernetes control panel or control plane. This is where decisions are made about the cluster, such as scheduling, and detecting/responding to cluster events. The components of the master can be run on any node in the cluster. Below is a breakdown of each of the key components of the master.

Kubernetes uses etcd as a key-value database store. It stores the configuration of the Kubernetes cluster in etcd. It also stores the actual state of the system and the desired state of the system in etcd. If they diverge, Kubernetes makes changes to reconcile the actual state and the desired state.

a) Etcd:  

In the kubernetes, is considered as the distribution that can be simply run on any system at the same moment. It stores the data in the form of key-value. In other terms, the kubernetes uses etcd as a major key-value. The only nuance is that etcd is a distributed database – because Kubernetes is a distributed system. It holds the ability to store multiple nodes’ data. It always contains the backup plan of every etcd data of your kubernetes cluster.
As we have discussed that kubernetes leverages the etcd distributes the key-value and takes care of the replicate the data that has been taken through the kubernetes cluster. The Raft consensus algorithm helps to etcd to recover the hardware failure and network partitioning.

b) API Server: (Application Program Interface):

API is the way to interact with certain applications, system & libraries, etc. It works as a front-end of the kubernetes control panel. All the operations on the cluster run through the API server. API implements an interface, that means different tools and libraries can easily communicate with it. kubeconfig is a package along with server tools that use for communication purpose.        

c) Kube- controller- manager:

It is a controller process. It runs a group of controllers in which the clusters’ desire state subsumes in this process. Kubernetes is responsible for a particular resource in kubernetes. If we talk about the controller process, the replication controller controls a set of replicas for pods & endpoint controllers like populates services, pod, other components. In this, every single controller is a separate process but without any complexity, they all are compiled into a single binary and run in a single process. The controllers we're talking about are:

  1. Node Controller: It is responsible for noticing and responding when nodes go down.
  2. Replication Controller: The other controller is the replication controller, which is responsible for maintaining the number of pods for every replication controller object in the particular system.
  3. Endpoints Controller: It actually populates the endpoints object (like joins services & pods)
  4. Service Account & Token Controllers: This controller has mainly created default accounts and API access tokens for new namespaces.  

d) Cloud- controller- manager:

Cloud controller management permits cloud vendors code and the kubernetes code to evolve independently of each other. Mainly it is responsible for managing controller processes with dependencies on the underlying cloud provider cloud-controller-manager runs controllers that interact with the underlying cloud providers. It holds the controllers that have the cloud dependencies, such as Node Controller, route, service and volume controllers. In prior releases, Kubernetes code was dependent upon cloud-provider-specific code for functionality.

Look at the cloud dependencies:

  1. Node Controller- If the node stops working, deleted, or unable to respond in that case, it checks the node status.
  2. Route Controller: It checks the underlying cloud infrastructure that routes up for setting.
  3. Service Controller: It provides the cloud provider for creating, updating and deleting load balancers.
  4. Volume Controller: For creating, attaching, and mounting volumes, and interacting with the cloud provider to orchestrate volumes.

e) Kube- Schedular:

The Kube- scheduler schedule the pod. The scheduler will define the work on behalf of resource utilization. It is a key component of kebernetes master which manage the workload the nodes of the cluster.  It is a service in a master that is responsible for distributing the workload. The scheduler is responsible for workload utilization and allocating pod to the new node.

2) Kubernetes- Worker Components

a) Docker:

It runs the applications in the form of container through the users can easily access the site and application. It provides a secure connection to access the site and stores the data securely.

b) Kubelet:

It is a kind of agent that runs each node in the cluster and make sure that the containers are running in a pod. Kubelet takes a set of pod space which provides the mechanism where the container can run healthily. Kubelet doesn’t manage the containers that are not designed on kubernetes. It is a minute service and responsible for each node that relaying from the control plane service. It interacts with the ETCD store to read the configuration details & wright values. This communication with the master component to receive commands and work according to that. It holds the responsibility to maintain the state of work and node server and manage the network port forwarding.

c) Kubernetes Proxy Service:

Proxy services runs in each node and supports the services available to extra nodes. It forwards the request to the correct container and capable of performing the primitive load balancing. Proxy checks the network environment and makes sure that the network environment is accessible and predictable. It manages the pod on node, volumes, secrets and forging new containers and health-checkup.

3. Container Runtime:

It is a software that is fully reliable for running containers. Kubernetes supports several runtimes: Docker, cri-o, rktlet, containers, and any implementation of the Kubernetes CRI (Container Runtime Interface).

4.  Kubectl:

It is a command-line tool that interacts with Kube-API server and sends commands to the master node. Each command is converted into an API call.

Signing Off:

In this article, we have explained the basics of Kubernetes along with its history. To the learners, this tutorial would be good to initiate the docker and kubernetes. You will get a thorough overview of kubernetes and learn how to use kubernetes in docker. Hope this tutorial helps you throughout. We will provide you more about Kubernetes and Docker Swarm in our later blogs. Till the, Learn and try something new this time.

For Reference: https://kubernetes.io/docs/tutorials/kubernetes-basics/

If you have any queries do add your questions, kind reviews & comments in the below section.