A simple introduction to Kubernetes and the world of containers

A simple introduction to Kubernetes and the world of containers

Automatic computer updates are annoying, especially when you’re in a rush — but imagine that on a company-wide scale. It’d be a complete disaster: when the system’s down, people can’t work.

Developers need to be able to update and maintain their company’s systems without bringing the whole organization to a standstill. And, as containers become ever-more popular, dev teams need more efficient ways to manage their systems. This is where Kubernetes comes in. Here’s everything you need to know about this sophisticated but powerful tool.

What is Kubernetes?

Kubernetes, or K8s for short, is an open-source container-orchestration tool designed by Google. It’s used for bundling and managing clusters of containerized applications — a process known as ‘orchestration’ in the computing world.

The name Kubernetes originates from Greek, meaning helmsman or pilot.

To fully understand Kubernetes and its advantages, we first need to take a look at how it all started.

Why do we need Kubernetes?

Organizations used to run on physical servers. The problem was, when performing multiple tasks on a single server, one application could take up most of the resources causing others to underperform. One solution was to have more servers, but as you can imagine, this got expensive pretty quickly.

Then things shifted towards virtualization. Multiple Virtual Machines (VMs) could run on a single physical server’s CPU, which meant that several applications could run simultaneously without performance issues. VMs also allowed applications to be isolated, which added an extra layer of security and flexibility. When one application needed to be added, updated, or repaired, the overall system remained unaffected. The main issue with VMs was their large memory usage.

What are containers?

Containers are similar to VMs. They have their own operating systems, file systems, CPU, memory, and process space — and they can be decoupled from the main infrastructure. The main difference is: they have a much lower memory footprint due to their relaxed isolation properties.

Container Deployment ExplainedImage Source

We use containers today. Containers run many complex application clusters, which are often challenging to manage efficiently. This is where Kubernetes steps in.

What does Kubernetes do?

In a nutshell, container orchestration tools, like Kubernetes, help developers manage complex applications and conserve resources.

Developers manage the containers that run applications to ensure there’s no downtime. If one container fails, another needs to take its place. Kubernetes handles this changeover automatically and efficiently by restarting, replacing, and killing failed containers that don’t respond to a health check.

It also monitors clusters and decides where to launch containers based on the resources currently being consumed — which means it’s useful for scaling, deployment, and general application management.

Kubernetes architecture explained

The Kubernetes command-line interface is called kubectl. It’s used to manage clusters and instruct the Kubernetes API server. The API server then adds or removes containers in that cluster to make sure the desired and actual states match.

The basic Kubernetes process:

  1. Admin defines the desired state of an app, then puts that in the manifest file.
  2. This file is sent to the Kubernetes API Server using a Common Language Infrastructure or User Interface.
  3. Kubernetes stores this file in a database called the Key-Value Store.
  4. It then implements the desired state on all the relevant apps within the cluster.
  5. Kubernetes then continuously monitors the elements to ensure the current state matches the desired state.

A Kubernetes cluster is made up of the master node, worker nodes, and pods. Here’s what each of these terms means.

  • Cluster
    This is a collection of servers, including the API server.
  • Master node
    The master is a collection of components that make up the control panel of Kubernetes. These are used for each cluster decision.
  • Worker Node
    Worker nodes check the API Server for new work assignments, which they then carry out. They report back to the Master Node.
  • Pods
    A pod is the smallest scheduling element. It works as a wrapper for each container. Without it, a container cannot be part of a cluster. If the developer needs to scale an app, they start by adding or removing pods.
  • Kubelet
    This sources the configuration of a pod from the API server and ensures the described containers are functioning correctly.
  • Docker Container
    These run on each of the worker nodes, which, in turn, run the configured pods.
  • Kube-proxy
    This network proxy performs services on a single worker node.

Kubernetes Architecture DiagramImage Source

To learn more terminology, visit the Kubernetes website, which includes a full glossary, with explanations.

What are the benefits of Kubernetes?

Kubernetes is a powerful tool that lets you run software in a cloud environment on a massive scale. If done right, it can boost productivity by making your applications more stable and efficient.

  • Improved efficiency
    Kubernetes automates self-healing, which saves dev teams time and massively reduces the risk of downtime.
  • More stable applications
    With Kubernetes, you can have rolling software updates without downtime.
  • Future-proofed systems
    As your system grows, you can scale both your software and the teams working on it because Kubernetes favors decoupled architectures. It can handle massive growth because it was designed to support large systems. Furthermore, all major cloud vendors support it, offering you more choice.
  • Potentially cheaper than the alternatives
    It’s not suitable for small applications, but when it comes to large systems, it’s often the most cost-effective solution because it can automatically scale your operations. It also leads to high utilization, so you don’t end up paying for features you don’t use. Most of the tools in the K8s ecosystem are open-source and, therefore, free to use.

What are the disadvantages of Kubernetes?

As with all things, Kubernetes isn’t for everyone. It’s famously complex, which can feel daunting to developers who aren’t experts with infrastructure tech.

It may also be overkill for smaller applications: it was made for huge-scale operations, rather than small websites.

Final thoughts

Kubernetes isn’t necessarily the right option for smaller applications — but for big organizations, fast-growing startups, or companies looking to upgrade a legacy application, Kubernetes is a powerful, flexible choice.

Adopting new processes and technology is never easy. But the more flexible and user-friendly you can be when it comes to rolling out this notoriously complex tool, the happier and more collaborative your team will be.

The best way to get started is to give dev teams access to the tool as early as possible, so they can test their code early on and prevent expensive mistakes further down the line.

You can also help teams understand the basics with a Kubernetes architecture diagram. This visualizes the automation plan for deploying, scaling, and managing containerized applications — which makes it easier for teams to understand the process.

Kubernetes Diagram Template - CacooKubernetes Diagram Template available in Cacoo

Architecture diagrams are essential for getting your teams working together. And, with the Kubernetes icons and templates now available in Cacoo, you can quickly create and share your architecture with anyone.

Georgina Guthrie Georgina is a displaced Brit currently working in France as a freelance copywriter. Before moving to sunnier climates, she worked as a B2B agency writer in Bristol, England, which is also where she was born. In her spare time, she enjoys old films and cooking (badly).