What is Kubernetes and What is Kubernetes used for?

Kubernetes is an open source system for automating deployment, scaling and management of containerized applications.

It was built by Google and donated to the Cloud Native Computing Foundation in 2015.

The word “Kubernetes” is ancient Greek for “helmsman of a ship.” Kubernetes provides tools that can be used for deploying multi-container applications, managing the containers that make up such applications, and setting up networks among containers.

In this article, you will learn about Kubernetes in detail and what it is used for.

So let’s get started!


What is Kubernetes

Kubernetes is one of the most popular open-source tools for configuring, deploying, and managing containerized applications.

Kubernetes has three main features which are an API server, a controller manager, and a scheduling engine.

The API server enables developers to configure their applications through JSON/YAML configuration files.

The controller manager handles tasks such as replication controllers. The scheduling engine handles computing resources by distributing pods across nodes in the cluster based on the requirements of the application.

Kubernetes has three main objects: pods, services and replication controllers.

A pod is a group of containers which are deployed together on nodes in the Kubernetes cluster. Containers running in a pod share resources such as files, networking interfaces, and volumes with each other. A pod can contain multiple containers from different sources, such as a Docker image.

A service is an abstraction for microservices. A Kubernetes service describes how to access pods by providing a name and a cluster-unique IP address.

The service allows the user to expose specific pods using labels. Users can create their desired number of replicas of each pod defined in services according to their needs.

A replication controller creates or terminates pods according to specified pod templates.

ReplicaSets are the objects that are managed by replication controllers. A replication controller can manage multiple replicaSets, each of which specifies a template for creating pods and an number of replicas in the pod. The controller also ensures that a specified number of pod “replicas” are running at any given time.

In principle, a Kubernetes cluster can run on a set of commodity servers that provide local storage and run Linux operating systems.

All containers in a single cluster share the same operating system kernel but may be packaged with different distributions, libraries and applications. Kubernetes supports Docker containers and also offers its own container format called PetSets.

Kubernetes implements the master-slave architecture, where one may have multiple masters or none at all for high availability. Every node runs one or more pods, each of which contains one or more containers that are managed by Kubernetes.

Master components send Pod status updates to their registered Scheduler(s), which are responsible for assigning Pods to available nodes.

Kubernetes has a large and active open source community, including many corporate contributors. The Cloud Native Computing Foundation does not manage the code base but serves as an independent voice.

Google Kubernetes Engine (GKE) provides hosted Kubernetes on Google Cloud Platform that supports other container services that run in Google cloud.

GKE is a managed service for deploying containerized applications in the Google Cloud Platform (GCP) and includes built-in support for common tasks such as network management, load balancing, logging and availability.

GKE sets up a Kubernetes cluster with two or more virtual machines running on the Google Cloud. It provides what is called a single master cluster, meaning that there is only one master node.

The GKE model also offers security and integration with other cloud services such as IAM (Identity and Access Management), logging, monitoring, metadata support and storage.

History of Kubernetes

The first release of Kubernetes was on December 13, 2015 after the project was donated by Google to the Cloud Native Computing Foundation.

The first version of Kubernetes had a lot of features and capabilities that were later improved and refined. This included an API server and etcd and more than ten thousand users within five weeks of release.

The next major release of the project happened on July 21, 2016 as version 1.1. In this release, many new features were added including support for custom resources and extensibility, as well as a fully API compatible file system implementation among hundreds of bug fixes. The next point release has been made one month later as 1.2-beta on August 11, 2016.

There was no major release of the project in 2017 up until the last quarter when Kubernetes version 1.9 has been released on December 12, 2017 with more than 1400 enhancements over previous versions.

This new minor update included Improved service accounts and authorization, storage for persistent application credentials, new security context constraints, multi-zone “cluster-autoscaler” and DNS service in beta, among many others.

What is Kubernetes used for?

Kubernetes is an open-source container orchestration technology that allows cloud applications to run on an elastic web server framework.

Kubernetes can be used to outsource data centers to public cloud service providers or for large-scale web hosting.

A few important things to note about Kubernetes are:

  • It’s designed for large-scale production so it’s best suited for environments with high amounts of traffic or users.
  • This is also great for development teams because it makes managing and deploying so much more efficient than manually deploying each service separately.
  • Kubernetes comes with built in data replication, load balancing, and cluster auto healing so you can add or remove nodes with ease.

What things you can do with Kubernetes?

  • Containers may be orchestrated over many hosts.
  • Make better use of hardware to get the most out of the resources you need to operate your business apps.
  • Control and automate the deployment and updating of applications.
  • On-the-fly scalability of containerized apps and their resources.
  • Declaratively manage services, which ensures that your deployed applications are always functioning as you planned.
  • Autoplacement, autorestart, autoreplication, and autoscaling allow your apps to health-check and self-heal.

Terms related to Kubernetes

Cluster: Group of one or more machines with shared storage which provide a single namespace and unified management.

API Server: Server that provides access to upstream REST API Server services.

Pod: A group of one or more containers (such as Docker) running on the same machine, typically for horizontal scaling purposes. Pods share network and folder space through cgroups, but not hostname.

Replication Controller: Component responsible for ensuring that a specified number of pod “replicas” are running at any given time. If there are too many, it will kill some; if there are too few, it will create more using a template. Replication Controllers may optionally use rolling updates to ensure that pods don’t experience abrupt changes.

Namespace: A namespace is a label for identifying a set of resources (e.g., pods). It only identifies subsets of those resources and can be used in conjunction with other labels to drill down into subsets within the broader category.

Label: A label is key-value metadata that can be attached to resources (e.g., pods). Labels are used for organizing and selecting subsets of resources, like grouping all Pods containing the word “frontend” together for easy management. Labels allow users to query their resources using these labels as filters. Note that labels can also be used for filtering and selecting subsets of resources.

Label selectors: A selector is the query language used when filtering resources by label.

Pod anti-affinity: Prevents two containers from running on the same machine.

Stacks: A grouping of one or more Replication Controllers and Services which together manage a set of pods as a single system. Stacks can be created to support common scenarios such as load balancing, replication, failover, and roll-back recovery.

What is a Kubernetes Pod?

A Kubernetes Pod is a group of one or more containers that provides an isolated environment for running a single application.

Pods provide shared volumes, hostname, and IP address that are distinct from other pods on the same node.

If you have an app that needs to be scaled up on a cluster, you can create multiple copies of the pod on different nodes and it will ensure that your app does not go down because of a node failure.

It also ensures that it does not use more storage on a node than is allocated to pods.

What is Kubernetes Cluster?

Kubernetes Cluster is a set of computing nodes that work together to achieve a common goal. Kubernetes cluster usually comprise of multiple layers and a controller at the top which monitors and coordinates the clusters.

Clusters in Kubernetes are created to help distribute workloads in an efficient manner. A cluster can be created with a docker container or physical machines.

In order for the Kubernetes cluster to be useful, it needs to have access to storage, networking, and compute resources.

What is Helm Kubernetes?

Helm Kubernetes is an open-source tool for managing Kubernetes applications. It is the missing upstream package manager designed to make deploying complex applications on Kubernetes easy.

What is Rancher Kubernetes?

Rancher is a complete software stack for teams that are adopting containers.   It solves the operational and security problems of managing numerous Kubernetes clusters across any infrastructure while also giving DevOps teams integrated capabilities for running containerized workloads.

What is Ingress in Kubernetes?

Ingress is a Kubernetes resource that can be used to expose pods to other services, typically HTTP. An ingress controller managing the ingress resources will need to be deployed via a pod or deployment. The ingress controller is responsible for providing SSL termination, request redirection, and load balancing.

An ingress object will typically consist of two parts: the rules which specifies how requests are redirected based on external paths/domains or based on internal traffic policies. The second part is an annotation that defines the type of load balancing mechanism (e.g., round robin, url hash).

What is a Kubernetes Node?

Kubernetes Nodes are logical groups of IT resources that support one or more containers.

Nodes house the services required to operate Pods (Kubernetes’ container units), connect with master components, setup networking, and run workloads. One or more Pods can be hosted by a Node.

What is a Kubernetes operator?

A Kubernetes operator is a controller that is tailored to a particular application. It extends the Kubernetes API to create, setup, and manage complicated applications on behalf of humans.

What is Docker and Kubernetes?

Docker and Kubernetes are both containerization tools for deploying and running containerized applications. Docker is a computer program that runs on Linux to build, ship, and run containers. Kubernetes is a system designed by Google that can be used to manage multiple containers across various hosts.

Kubernetes is widely considered the orchestration standard for Docker containers.

What is Namespace in Kubernetes?

A namespace creates a new user-defined partition for Kubernetes objects, allowing for easier management of object content. You can think of namespaces as directories that store objects such as pods and services.

Controllers such as ReplicaSets and Deployments can be created in a namespace to inherit its access policies, allowing them to share the same resources with the other objects in the namespace.

How to check Kubernetes version?

There are two ways to check the Kubernetes version.

The first is via the kubectl version command, which returns a single line of output that includes the version number.

The second is by using kubectl cluster-info , which returns a more detailed view of your current setup.

How to learn Kubernetes?

A few of the resources to learn Kubernetes are:

1. Learn Kubernetes Basics – https://kubernetes.io/docs/tutorials/kubernetes-basics/

2. Kubernetes CNCF: There are many resources and tutorials on Kubernetes here if you need help learning it.

3. Some of the best book you can read – Kubernetes Books

YouTube video

You Might Also Like