1.1 Kubernetes

Kubernetes is an open-source container orchestration system that allows you to manage and easily scale containerized applications on distributed infrastructure. It operates through a set of components that work together to provide a highly scalable and redundant application management infrastructure. Kubernetes greatly simplifies application management by automating the deployment, scalability, and management of applications in containers, minimizing operational complexity.
Kubernetes offers a wide range of features, such as:
  • Automatic deployment;
  • Resource management;
  • Automatic updates;
  • Horizontal and vertical scaling;
  • Configuration management;
  • Storage volume management;
  • Traffic distribution;
  • Event and log management.
With these features, Kubernetes makes it easier to manage container applications and handle complex, large-scale environments.

clusters

A Kubernetes cluster is a set of nodes (or machines) that run Kubernetes software and work together as a single cohesive system to manage and orchestrate containers. A cluster allows you to manage containerized applications in a scalable, redundant, and reliable manner.

In a Kubernetes cluster, a node can take on the role of a control plane node, which coordinates all cluster activities, or a worker node, which runs the containerized applications. The control plane node handles deployment, scalability, and application management on worker nodes.
Worker nodes run application containers and communicate with the control plane node to receive instructions.

A Kubernetes cluster offers several features like automatic deployment, resource management, automatic updates, horizontal and vertical scaling, configuration management, storage volume management, traffic distribution, and event and log management. These functionalities simplify the management of containerized applications, enabling easy handling of complex and large-scale environments.

containers

A container is an executable instance used to host an application or service. A Kubernetes container is a logical computing unit that is managed and orchestrated by the Kubernetes system within a cluster. Kubernetes uses containers to run applications in isolation, allowing multiple containers to coexist on the same machine without interfering with each other. Each container has its own isolated file system, network configuration, and processes. This means updating one container does not affect others running on the same machine.

A group of containers is organized into a logical unit called a "pod." Pods are the basic orchestration units in Kubernetes, and they can contain one or more containers. Kubernetes manages pods as single entities, allowing scaling, updating, or replacing containers within them independently.

A Kubernetes container is an executable instance managed and orchestrated by the Kubernetes system within a cluster to host an application or service.

control plane nodes

The control plane node is the central component of the cluster responsible for managing and controlling resources within the cluster. It coordinates and distributes tasks among worker nodes within the cluster and manages resources, including creating and managing pods, allocating resources, application scalability, and event management.

The control plane node comprises several components, including the API server, controller manager, scheduler, and etcd (a distributed database for storing cluster configuration information). These components work together to ensure the cluster is always in a coherent and operational state. The Kubernetes API server is the main entry point for cluster management, allowing interaction with the control plane node using the kubectl command-line interface or other user interfaces. The controller manager oversees the controllers that control the status of resources within the cluster and manages actions in response to specific events.

In Kubernetes, the control plane node is a crucial component of a cluster, ensuring resource consistency and management within the cluster, simplifying application management and orchestration.

worker nodes

A worker node is a node within a Kubernetes cluster that runs application containers. It's one of the two node types, alongside the control plane node. The worker node executes application containers, following specifications from the control plane node. It manages container lifecycles within the node, executing instructions for starting, stopping, or restarting containers. The worker node is also responsible for node-level resource management, including CPU, memory, storage, and network.

A worker node communicates with the control plane node via the Kubernetes API server to receive instructions and cluster status information and sends information about available resources and container statuses.

The worker node handles application execution within a cluster, and its horizontal scalability allows adding or removing nodes as needed to manage resources.

Node Pool

A Node Pool is a group of nodes in a Kubernetes cluster with similar hardware characteristics like CPU, memory, storage, and network capacity. Node Pools allow horizontal scaling of nodes within a Kubernetes cluster. Nodes can be added or removed based on application needs. When creating a Node Pool, you specify the hardware characteristics for nodes in that pool, ensuring they share the same specifications and are suitable for running similar applications.

When an application is run within a cluster, Kubernetes evaluates available resources to determine where to run containers. If nodes in a pool are saturated, Kubernetes can automatically create new nodes to meet resource demands. Node Pools offer flexibility and scalability in resource management, allowing dynamic cluster capacity adjustments.

kubelets

A kubelet is an agent that runs on each node in the cluster and manages the execution of containers within the node. The kubelet is one of the main components of the worker node and is responsible for communication between the node and the cluster master. The kubelet monitors the status of the containers within the node and ensures that the containers are running correctly. If a container crashes, the kubelet detects it and attempts to restart it automatically. The kubelet also manages the node's resources, such as CPU, memory and storage, to ensure that containers running on the node do not consume more resources than are available.

It interacts with the control plane node through the Kubernetes API server, which provides cluster status and container management instructions. The kubelet also sends information on the status of containers executed on the node, including any errors or problems.

The kubelet in Kubernetes is an essential agent for managing containers within a worker node, ensuring that containers run correctly and reliably and guaranteeing that the worker node respects the cluster's resource management policies.

kubectl

Kubectl is the official command-line interface (CLI) used to interact with a Kubernetes cluster. It is a powerful, flexible tool for managing cluster resources, such as creating or deleting pods, scaling applications, configuring services, and viewing application logs. Kubectl makes it easy for admins and developers to perform common cluster management tasks using intuitive, well-documented commands. It connects to the control plane node via the Kubernetes API server, allowing command submission through the CLI.

Kubectl is highly customizable and allows the creation of customized scripts and commands to simplify repetitive tasks. In addition, kubectl supports autocompletion of commands and resource names, simplifying command typing.

Kubectl is an essential tool for Kubernetes cluster management, enabling efficient resource management and simplifying cluster administration and development operations.

pods

A pod is the smallest application orchestration unit, grouping one or more containers that share the same network space and resources within a node.

Containers in a pod share the pod's IP and port, enabling communication using localhost. They can also share data volumes for file and resource sharing. Managed by the control plane node, a pod is kept running and functional. If a pod fails, it is restarted automatically or replaced.

Pods enable horizontal scaling by running multiple application instances on a node, with each instance in a separate pod.

Pods are an important abstraction for application management, simplifying container execution and resource management, and enhancing application reliability.

API Server

The API Server is a crucial component of the control plane node, providing a primary interface for interacting with the Kubernetes cluster. It allows users and external tools to manage resources and control system state.

It manages user authentication and authorisation, validates requests, persists resource data and controls operations on resources within the cluster.

etcd

Etcd in Kubernetes is a key component that provides a distributed data storage system to store and manage cluster status and configuration information and other resources.

It replicates data across cluster nodes for redundancy and reliability, organizing data in a hierarchical key-value structure.

Each node in the tree may contain a unique key and an associated value. This enables reliable resource and state management in Kubernetes.

scheduler

The scheduler is responsible for assigning pods to virtual machines (VMs) or cluster nodes. It distributes and balances workloads efficiently across cluster nodes, considering resource requirements and constraints.

The scheduler selects the most suitable node for each pod based on preferences, constraints, and scheduling algorithms. The scheduler plays a key role in ensuring the scalability and efficiency of distributed applications in Kubernetes.

controller

A controller is a software component managing resource lifecycle and ensuring desired states within the cluster.

Key features of a controller in Kubernetes include:
  • Monitoring - constantly checks cluster and resource status via the API server;
  • Reconciliation - ensures actual resource states align with desired states;
  • Event Management - handles cluster events like resource creation/modification/removal;
  • Scalability - can be scaled horizontally for large workloads;
  • Dependency Management - manages dependencies between resources.
Controllers are key to application orchestration in Kubernetes.