It’s simply Kubernetes

Aman Arham
6 min readJul 19, 2020

We have gone through the Fundamentals of Docker and now it is time to move onto some new and advanced pieces of technologies. You may be thinking, “What else is there besides Docker running in the background”. Well, I’m here to tell you that there is another service that works alongside Docker. That service is Kubernetes. In this blog, I will be going over a high-level overview of Kubernetes and will be helping you get started using Kubernetes.

What is Kubernetes

Like before, I will be going over the general overview of Kubernetes before going into technical detail. So, in essence, Kubernetes is a distributed systems framework which was created by Google and acquired my Cloud Native Computing Foundation(CNCF) and focuses on orchestrating and managing your containers and applications. In addition, Kubernetes aims at automating the process of managing and load balancing to the traffic of your web-app. Because of this automation feature, Kubernetes has gained a lot of popularity and has taken control in the tech market, running in the backend of most applications, alongside containers. On the topic of containers, Kubernetes actually utilizes containers to operate the application in an organized manner. So both are related and are crucial in running an application.

Kubernetes Architecture

Credits to Mumshad Munnambeth for the Diagram and great course

This diagram gives an overview of a Kubernetes Cluster and what components are in. You will notice the master-node and the worker-nodes present in the diagram. I will explain what each one does briefly. Worker-nodes focus on running workloads by placing many containers in the node. These “many containers” are referred to as pods in Kubernetes and are located/assigned to a specific node. Then there is the Master-node, and this is a specific node that manages the cluster and the operations that occurs in it. Some of its responsibilities include of watching all of the worker nodes and orchestrating the containers or pods and applications.

When installing Kubernetes, there are many services that are installed along with it and those services are:

  • API Server: Acts as a Frontend for the Kubernetes Cluster and interacts with the cluster and other components/services.
  • ETCD Server: Is a key-value store and is used to store data needed for the cluster. Includes of logs(storing information in a distributed fashion).
  • Scheduler: Distributes work across the worker-nodes(ex. if 1 node is getting more traffic and is working more, the scheduler will distribute traffic to the other nodes for efficiency).
  • Controller-Manger Service: This is the brain the orchestration process and is responsible for responding when the nodes/containers go down and helps in running the containers. There are two types of controller-manager services: Node-Controller(makes sure the nodes are running pods) and Replication Controller(helps when nodes go down to get it up and running again).
  • Kubelet: This is the agent that runs on each of the Worker-nodes in the cluster. It is responsible for making sure the containers are healthy and running fine and provides constant information to the Master-node.
Once again, than you to Mumshad Munnambeth for the diagram and great course

All of these services are present in the cluster, but in different areas. As shown in the diagram, the ETCD, API-SERVER, Controller-Manager, and Scheduler services are present in the Master-node and the Kubelet and Kube-proxy is in the Worker-node. Kube-proxy focuses on route trafficking and managing what each node can handle. For a more in-depth view on the Kubernetes Architecture and a analogical example, check out Mumshad Munnambeth’s video:

Getting Started with Kubernetes

Installing the Kubernetes Tool

In comparison to Docker, Kubernetes does not take many steps in order to set-up. There are 2 main things that must be done in order to run Kubernetes.

First, you must install the main Kubernetes tool. Run this command in the terminal(for MAC users):

brew install kubectl

This will install HomeBrew in your terminal and you will be able to use the kubeadm utility and the kubectl(Kubernetes CLI Tool). This tool will allow you to create and edit certain aspects in the cluster. To make sure that kubectl was installed successfully, run:

kubectl version --client 

This command will verify the version of Kubectl that you are running.

Installing Kind and Creating the Cluster

The next main step is getting your environment and platform ready. This is key when using Kubernetes and will allow us to utilize the kubectl tool.

In this step, we will be installing the software Kind. This specific software allows for users to run a local Kubernetes cluster on your PC and will utilize the Kubernetes CLI tool. In order to install kind, run this command:

brew install kind

Once this installation is complete, run this command:

kind version

This will display to the user the version of Kind that is running and indicates that you have successfully installed the software. However, we are not done yet.

We must set-up the environment and create a Kubernetes Cluster using Kind. This will create the pods and nodes needed in order to run this cluster. To do that, run this command:

kind create cluster

Something similar to this should appear in the terminal console:

Now the environment has been created. There are nodes and pods running in the background. In order to view the pods that have been deployed, run this command:

kubectl get pods -A

As you can see, we are utilizing the Kubectl tool in order to view the pods however, there are many more functions and capabilities that this tool has, especially in a Kuberenetes environment such as this cluster. In addition, we are using the -A to list the pods in all namespaces. When this command is run, you should see pods running, such as these:

You can also view you cluster and its name by using the command:

kind get clusters

You will notice that Kind has its own CLI tool and it can accessible anywhere within the terminal, as it has been install. This tool mainly deals with edits and management of the cluster.

Now you are ready for the large journey ahead of you in the realm of Kubernetes!!!

You are Ready!

Now that you have learned about Kubernetes, its correlation with Containers, and the installation process of kubectland kind, you are ready to get started with Kubernetes. Time to wait for my next few blogs where I will discussing the different ways to create Pods and many other aspects of a Kubernetes Cluster using YAML. Check out some of the many presentations given at Kubecon, an annual conference held by CNCF where presenters come and discuss many different components and use-cases of Kuberenetes, to get some insight on how Kuberentes is changing the game. Until next time, Aman Arham out!

--

--

Aman Arham

Senior at Rick Reedy High School and aspiring Data Scientist; Writer for Better Programming.