Kubernetes

Kubernetes is a system that Google initially designed, inspired by a similar system called Borg, which was designed and developed by Verma et al.A. Verma, L. Pedrosa, M. R. Korupolu, D. Oppenheimer, E. Tune, and J. Wilkes, “Large-scale cluster management at Google with Borg,” Proceedings of the European Conference on Computer Systems, Eurosys, 2015. and Burns et al.B. Burns, B. Grant, D. Oppenheimer, E. Brewer, and J. Wilkes, “Borg, Omega, and Kubernetes,” ACM Queue, volume 14, pages 70-93, 2016, 2016.. The Cloud Native Computing Foundation now maintains Kubernetes. It manages a cluster of nodes and other resources (e.g., disks), handling all the aspects of running software in the cluster, such as deployment, scaling, and discovery.

Kubernetes cluster

A Kubernetes cluster contains a set of nodes that can have two distinct roles. They can either be a worker node or a manager node.

Worker and manager nodes

  • A worker node is responsible for running the user applications.
  • A manager node is responsible for managing and coordinating the worker nodes.

Essentially, worker nodes make a set of resources available to the cluster, and manager nodes decide how these resources are allocated to the applications that need to be executed as specified by the user.

Note that these applications can be divided into two main categories: long-running services that constantly run and typically respond to incoming requests, and jobs that run for a bounded amount of time typically doing some data processing.

Achieving availability and durability

For availability and durability in Kubernetes, multiple manager nodes can run in parallel, with one of them operating as the active leader and the rest acting as passive followers.

Kubernetes utilizing etcd

Kubernetes uses etcd for various purposes, such as:

  • Storing all the cluster data
  • Performing leader election
  • Transmitting change notifications between different parts of the cluster

Each node has several different components for the various functionalities that run independently, i.e., as separate processes.

Cluster resources

The various objects of the cluster (e.g., nodes, services, jobs) are called resources, and they are represented in etcd as key-value entries under the right namespace.

One of the most central resources in Kubernetes is the pod.

Pod

A pod represents the smallest deployable unit of computing.

In practice, a pod is a group of one or more containers with shared storage/network and a specification for how to run the containers.

A container is a lightweight and portable executable image that contains software and all of its dependencies. Kubernetes supports multiple container runtimes, with Docker being the most popular

Persistent volume

A persistent volume is a piece of storage in the cluster that has a lifecycle independent of any individual pod that uses it.

Job

A job creates one or more pods and ensures that a specified number of them successfully terminate.

Service

A service is an abstraction that defines a logical set of pods and a policy by which to access them.

Every resource is characterized by some desired state usually a desired number of replicas for a service. There are various components of Kubernetes that cooperate to ensure the cluster’s current state matches the desired state.

Note that the desired state is provided by the user when creating a resource (Spec), while the current state is supplied and updated by Kubernetes (Status).

The architecture of Kubernetes is shown in the the following illustration:

Press + to interact
Kubernetes architecture
Kubernetes architecture

We will learn about the components of manager and worker nodes in the next lesson.

Get hands-on with 1400+ tech skills courses.