This tutorial serves as an introduction to Kubernetes: What is it and why do you need it? If you are into containers, there are high chances that you have heard about Kubernetes, commonly abbreviated as K8s. So what is Kubernetes? Why do you need Kubernetes, how does Kubernetes work? What are the main benefits and key features of Kubernetes?
Table of Contents
Introduction to Kubernetes: What is it and why do you need it?
In this tutorial, we will explain;
- What is Kubernetes?
- Why you need it and how it works
- Key features of Kubernetes.
What is Kubernetes?
So, what is Kubernetes? Kubernetes, commonly abbreviated as K8s, the result of counting the eight letters between the “K” and the “s”, is a de facto standard tool for container orchestration, developed and open-sourced by Google in 2014. It provides a platform for automating the deployment, scaling, and management of containerized applications in a distributed environment. Kubernetes is a Greek name which means
Why do you need Kubernetes?
If you are dealing with a large scale container applications that are running across multiple hosts, you might have realized how cumbersome it is to manage and scale them up or down as needed, or even maintain high availability. This is where Kubernetes comes in to simplify the deployment, scaling, failover and management of containerized applications running across multiple clusters. All you have to do is to define how your application needs to run and Kubernetes will take the responsibility of scheduling and managing them containers on a cluster of machines.
Remember that Kubernetes is built on the principle of
declarative configuration and automation, a software development approach that enables you to define a desired state of a system or application. With declarative configuration, you only need to specify the desired state of your application for example which packages to be installed, what configuration to put in place e.t.c, and Kubernetes will take care of ensuring the actual state of the application/service matches the defined desired state. Kubernetes also uses controllers that continuously monitor the state of the application and automatically make changes as necessary.
So in short, you need Kubernetes because;
- It simplifies the deployment and management of containerized apps
- Scalability and high availability
- Ensures portability of applications across a wide range of infrastructure.
How Does Kubernetes Work?
Kubernetes uses the concept of a cluster. A Kubernetes cluster comprises of a set of machines, called
nodes, that work together to run the applications. Nodes operate in master-worker architecture. The
master node, also known as
control plane, is responsible for managing and coordinating the worker nodes. The worker nodes on the other hand are responsible for running the application workloads. Each node in the cluster runs a Kubernetes agent called a
kubelet, which communicates with the Kubernetes control plane to manage containers. Each application workload is run as a Pod, which is the smallest unit of deployment in Kubernetes and contains one or more containers. Thus, Kubernetes control plane creates necessary pods when an application is deployed and and schedules them to run on the worker nodes.
Key features of Kubernetes
Having said that, what are the key features of Kubernetes?
- Scalability: Kubernetes makes the management of the containerized applicationseasy by scaling them up or down automatically based on demand and resource levels.
- Self-healing: Kubernetes has the ability to automatically restarts containers that fail, replaces containers, kills containers that don’t respond to your user-defined health check thus ensuring that the application remains available and responsive even in the face of failures.
- Rolling updates and rollbacks: Kubernetes allows you to define a desired state of an application and it can implement that change in a controlled manner, hence makes it easy to deploy new versions of your application without downtime or disruption.
- Service discovery and load balancing: Kubernetes by default ships with built-in features for service discovery and load balancing, making it easy to route traffic to containers based on their labels or other attributes.
- Resource optimization: Kubernetes includes features for resource management and optimization, allowing you to manage and allocate resources such as CPU, memory, and storage in a flexible and efficient way.
- Portability: Kubernetes provides a standardized way to package and deploy containerized applications. This makes it easy to run your applications on different environments or cloud providers.
- Storage orchestration: Kubernetes allows you to automatically mount a storage system of your choice, such as local storages, public cloud providers, and more.
- Secret and configuration management: Kubernetes allows you to store, manage and deploy configuration secrets information such as passwords, OAuth tokens, and SSH keys without the need to rebuil your container images, and expose them in the stack configuration.
- Community Support: Kubernetes has a huge and active community of developers and users which provide good resources and support to anyone using the platform.
To that far, it can be noted that Kubernetes is a powerful container orchestration tool with a flexible and extensible architecture, built-in automation features, and support for portability and scalability. Thus, it is one of the must-know tool for any DevOps, Infrastructure Engineer or any software engineer working with containerized applications.
That concludes our guide on introduction to Kubernetes: What is it and why do you need it?
Read more on Kubernetes Overview.
Kubernetes Architecture: A High-level Overview of Kubernetes Cluster Components
Install and Deploy Kubernetes Cluster on Ubuntu 20.04