Author : MD TAREQ HASSAN | Updated : 2023/07/19

Container orchestration

Kubernetes 101

As Kubernetes is a container orchestrator, it needs a container runtime in order to orchestrate. Docker is mostly used container runtime. Kubernetes automates many complex tasks related to container orchestration, ensuring high availability, fault tolerance, and efficient resource utilization.

Kubernetes cluster

A cluster is a set of nodes that collectively provide the computing resources and infrastructure to run and manage containerized applications using the Kubernetes platform.

Node

Typically you have several nodes in a cluster, but you might have only one node.

Master node

Worker nodes

Control Plane

Kubernetes Cluster Compnents

Kubernetes components are the software modules that make up the Kubernetes control plane. These components run on the master node and are responsible for managing and controlling the cluster.

Control Plane Components:

Node Components:

The master node runs Control Plane Components, and the worker nodes run Node Components.

API server

API server handles API requests, validates them, and performs operations such as deploying applications or modifying cluster state

Desired State

Example: thermostat
When you set the temperature, that’s telling the thermostat about your desired state. The actual room temperature is the current state. The thermostat acts to bring the current state closer to the desired state, by turning equipment on or off.

Desired State in K8s
In Kubernetes, controllers are control loops that watch the state of your cluster, then make or request changes where needed. Each controller tries to move the current cluster state closer to the desired state.

Controller

There are several types of controllers in Kubernetes, each designed to manage specific resources. Here are some commonly used controllers:

Controller manager

Scheduler

etcd

Kubelet

Kube proxy

Container Runtime

Kubernates Resources

Kubernetes resources (“Kubernates Objects”) are the declarative objects that you define and manage within the cluster to represent the desired state of your applications and their associated components. Kubernates Resources are defined using manifest files (yaml or json) and are submitted to the Kubernetes API for execution.

Some of the key resources (Kubernates Objects):

Pod

Unlike in a Docker environment, you can’t run containers directly on Kubernetes. You package the container into a Kubernetes object called a pod. Each Pod is it’s own self-contained server. When a Pod runs multiple containers, the containers are managed as a single entity and share the Pod’s resources. A single pod can hold a group of one or more containers. However, a pod typically doesn’t contain multiples of the same app.

A kubenetes pod:

ReplicaSet

A Replica Set’s purpose is to maintain a stable set of replica Pods running at any given time.

Deployment

Service

StatefulSet

ConfigMap

Secret

PersistentVolume & PersistentVolumeClaim

Namespace

Endpoint

Dashboard

kubectl

Manifest file

Details: Understanding Kubernetes Manifest File