Welcome to an introduction to Kubernetes. What is Kubernetes? How does it work? In this post, we’ll look at these questions in more detail and give you a gentle introduction into Kubernetes. Kubernetes is not just a technology buzzword that’s thrown around constantly, it actually works. Forgetting about Google for a moment, many other companies are using it because it’s a big step in delivering truly scalable applications.

In a competitive and massive market, scalability is one of the cornerstones of a successful product. Imagine for a moment if Facebook, Twitter, or any other of the hugely popular apps only had the capacity to service maybe ten or twenty percent of their current user base. It’s simple, they would not have been so popular.

What is Kubernetes?

So, what exactly is Kubernetes? To define it, let’s look at the official definition. According to this, Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem and Kubernetes services, support, and tools are widely available.

Simply put, it allows you to manage containers, for example, those found when using Docker. Okay, so what is a container? A simple way to explain would be to use an analogy.

Think of a container as your backpack you take to work everyday. In it, you have your lunch, laptop, pens, pencils, and maybe a notebook or two. In other words, in your backpack you have everything you need to do your job. Now, if you didn’t have your backpack and relied on everything you need being at the office, you may end up looking for pens because someone else used them, or maybe a notebook that was left behind in the boardroom after the previous day’s meeting.

Likewise, a container has all the resources it needs to run an application in the container. This means that it’s not necessary that it competes for resources with other applications on the same machine. Like not taking your backpack to work, if the app wasn’t in a container it would compete with other applications for processing power, memory, and the like.

Now, if you have several containers running simultaneously, you need something like Kubernetes to manage these containers. Here, think of it as a conductor of an orchestra. The conductor decides which instruments plays when and how many instruments there are.

Want to level up your understanding of Kubernetes? Sign up to be notified of our latest K8s blog posts and updates.

Kubernetes Basics

The basic idea of Kubernetes is to abstract machines even further away from their physical implementation. So, it’s a single interface to deploy containers to all kinds of clouds, virtual machines, and physical machines. Considering this, it’s easy to see why Google created it because it has massive systems to run and manage.

Now that you know what Kubernetes is, let’s take a look at some of its basic vocabulary to get you acquainted.

Node

A node is a physical or virtual machine. You can create a node with a cloud operating system like Amazon EC2, or manually install them. This is the first step you need to take before getting started with Kubernetes as it doesn’t create nodes itself.

After you’ve done this, though, you can use Kubernetes to deploy your apps and from that point on, it can define things virtual networks, storage, and memory. Each node is managed by a Master, and every Kubernetes Node runs at least:

  • A Kubelet that’s responsible for communication between the Master and the Node. It manages the Pods and the containers running on a machine.
  • A container runtime, like Docker that’s responsible for pulling the container image from a registry, unpacking the container, and running the application.

Pod

Kubernetes creates a Pod to host your application instance. It’s a Kubernetes abstraction that contains one or more application containers and some shared resources for those containers like storage, networking, and information on how to run each container.

Pods are the basic units of the Kubernetes platform. So, when you create a deployment on Kubernetes, the Deployment, in turn, creates Pods with containers inside them. Each Pod is then tied to the Node where it’s scheduled and remains there until termination.

Deployment

A Deployment is a set of multiple identical Pods with no unique identities. It runs multiple replicas of your application and automatically replaces any instances that fail or become unresponsive. By doing this, it ensures that one of your instances are always available to serve user requests.

Managed by the Kubernetes Deployment Controller, Deployments use a Pod template which contains the specifications for its Pods. The specifications determine how each Pod should look like, for example, which applications should run in its containers, which volumes the Pod should mount, its labels, and more. When this template changes, new Pods are deployed in terms of the new specifications, one at a time.

Docker and Kubernetes

How Does Kubernetes Work?

When we look at how Kubernetes work, we can approach it from two perspectives. On the one hand we can use it as a container orchestrator, and on the other it’s used as a Kubernetes cluster.

A cluster is a set of nodes that run containerized applications. To work with clusters, you must first determine their state that defines operational elements like applications and workloads that should be running, images that these applications need to use, resources to be used, and the number of needed replicas.

You define the state by using JSON or YAML files to specify the application type and the number of replicas you need. Developers use the kubectl command line interface or use the Kubernetes API to directly interact with the cluster and to set its state. The master node then communicates the desired state to the nodes via the API.

Once defined, Kubernetes automatically manages the cluster to align with their desired state through the Kubernetes control plane that continuously loops to ensure the cluster’s actual state matches the defined state.

In contrast, when you use Kubernetes as an orchestration tool, you’ll describe the configuration in either a YAML or JSON file that tells the configuration management tool where to find the images, how to establish a network, and where to store logs.

When you then deploy a new container, the container management tool schedules the deployment to a cluster and finds the right host, in accordance with the requirements. The orchestration tool then manages the container’s life cycle based on the specifications provided in the compose file.

What Are the Benefits of Using Kubernetes?

When looking at the benefits of using Kubernetes, we’ll look at both the technical benefits as well as the benefits it offers businesses. And this makes sense, because the technical benefits give rise to the business benefits for any business that uses Kubernetes.

Technical Benefits

Using Kubernetes offers the following technical benefits:

  • You can control and automate deployments and updates.
  • It’s more efficient because it optimizes infrastructure resources and makes the most efficient use of hardware.
  • You can orchestrate containers on multiple hosts.
  • It’ll solve many common problems as a result of the proliferation of containers by organizing them in Pods.
  • It can scale resources and applications in real time.
  • It can test and autocorrect applications

Business Benefits

Flowing from the technical benefits, a business can enjoy the following benefits by using Kubernetes:

  • Because it makes deployment more efficient, it speeds up time to market.
  • Due to its efficiency, it brings about IT infrastructure cost savings.
  • It’s excellent at scaling and ensures that an application is always available.
  • It makes it easy to run any app on any public cloud service or any combination of public and private cloud services.
  • Because it runs consistently across all environments, it’s easy to migrate an application from an on-premises deployment to a cloud deployment.

Final Thoughts

There you have it. A short straightforward introduction to Kubernetes. But don’t let it stop here, read more and learn more about it.

Maybe more importantly, try it, deploy to Kubernetes, and see what it can do for you or your business.


ShuttleOps

ShuttleOps

Team ShuttleOps
Software delivery is now critical for virtually every organization, even if the process of deploying them can be hampered by mind-numbing complexity. We're on a mission to simplify application delivery. Our goal is to help remove the errors, latency, and outages that result from a sluggish application deployment process - so you can deliver fixes, features, and updates to your customers quickly and securely.

  • Instagram
  • LinkedIn
  • Facebook

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Dockerize a Spring Boot Application with...

Docker January 22, 2021

tl;dr – Step 1. Create Dockerfile, Step 2. Done! Introduction As a team we wanted to get a Spring...

Continue reading

EKS vs ECS vs EKS/ECS Fargate

Kubernetes January 19, 2021

If you are researching the various container orchestration service offerings on AWS, you may have realized that EKS and...

Continue reading

How to Deliver Software Like an Elite...

News January 8, 2021

As part of small/medium business, do you ever look to the likes of Facebook and think about their old...

Continue reading