Introduction to Kubernetes

Akash Verma
3 min readJun 29, 2020

In my last month’s blog, I talked about Docker that is a platform or ecosystem around creating and running containers. This month’s blog intends to talk about the Kubernetes which is an open-source container orchestration system for automating application deployment, scaling, and management.

Let us understand the problems that Kubernetes solves while working with containers so we understand the value it brings in.

Distributed Systems

In the microservices architecture, different services are deployed, scaled, and maintained independently. It is challenging to manage communications between services and at the same time ensure high availability of the systems to ensure end-user experience is not impacted in any manner. Additionally, the trend has shifted towards infrastructure as a code where you can deploy and manage services without manual intervention. Kubernetes checks all these boxes and helps in creating reliable systems.

Kubernetes Components

Kubernetes Architecture

When you deploy Kubernetes what you get is a cluster that consists of a set of worker nodes responsible for hosting Pods(that runs containerized applications). The worker nodes are managed by a control plane that also makes decisions about the cluster and responds to any cluster events.

On the worker side, kubelet ensures containers are running inside the pod and are healthy while Kube-proxy is a network proxy that adds communication capability to the Pods. You can refer to the official documentation to know about the components in detail.

Kubernetes Objects

Kubernetes objects are persistent entities in the Kubernetes system. Kubernetes uses these entities to represent the state of your cluster.

The Basic Kubernetes Objects are as follows:

  • Pod: Represents process running in your cluster. It is a wrapper around the container that runs containerized applications. Kubernetes manages the pods(not the containers directly).
  • Deployment: It provides declarations on how the pods have to be created and scaled. Deployment controllers always try to achieve the desired state given in the deployment file against the current state in the cluster.
  • NameSpace: They are used to organize objects in a Kubernetes cluster. They enable you to group resources together and perform actions on those resources. They can be used to manage different environments of the deployed services.
  • Service: It acts as a wrapper around the running Pods and exposes them as network service so that pods are able to communicate with other pods/namespaces. It also enables communication outside of the Kubernetes cluster. The kind of communication is controlled using the Type attribute in the service file.

You can check Kubernetes docs to know about other objects as and when you need to use them.

Out of the box, Kubernetes provides several key features that allow us to run immutable infrastructure. Containers can be killed, replaced, and self-heal automatically, and the new container gets access to those support secrets, configurations, etc. that make it work.

If you liked reading this, don’t forget to clap. 👏👏

You can also follow me on twitter @Akash940 for JavaScript or React updates.

Thank-you!

--

--

Akash Verma

JavaScript Enthusiast, Software Engineer @goevive. Follow me on twitter @Akash940