Skip to content

Kubernetes

Kubernetes is a container orchestration platform that automates the deployment, scaling, and management of containerized applications. It groups containers into logical units called pods, manages resource allocation, handles networking, and provides self-healing capabilities like automatic restarts and rolling updates.

How it is working

Everything in Kubernetes is a resource - Pods, Services, Deployments, ConfigMaps, Secrets, etc. are all treated as declarative resources. The desired state is declared through resource manifests (YAML files). The API Server stores these resource definitions in etcd (the cluster's database). Multiple controllers each handle different resource types (Deployment controller, Service controller, etc.) continuously work to reconcile the actual state with the desired state.

The process in action

You declare desired state e.g. YAML file, or command to the central entry point, the API Server. The API server stores it in the database (etcd). The Scheduler assigns Pods to nodes based on resource requirements. Controllers watch for changes in the database. If the state differs, controllers will take actions (create Pods, scale replicas, etc.) so that the system reaches the desired state. This declarative, state-driven approach is allowing self-healing and automated reconciliation without manual intervention.

Key features include

  • Containerization management - Works with Docker and other container runtimes
  • Auto-scaling - Scales applications based on demand
  • Load balancing - Distributes traffic across instances
  • Self-healing - Restarts failed containers and replaces unhealthy nodes
  • Rolling updates - Deploys new versions without downtime
  • Storage orchestration - Manages persistent volumes
  • It's widely used in cloud-native development for managing microservices at scale.

Resources

  • Pod - The smallest deployable unit; a wrapper around one or more containers that share networking and storage.
  • Service - Exposes Pods to the network, providing stable IP addresses and load balancing across Pod replicas.
  • Deployment - Manages Pod replicas, handles rolling updates, and ensures desired state by automatically creating/scaling Pods.
  • StatefulSet - Similar to Deployment but for stateful applications, maintaining stable pod identity and persistent storage ordering.
  • DaemonSet - Ensures a Pod runs on every (or selected) node in the cluster; used for monitoring, logging, or node utilities.
  • Job - Runs Pods to completion; useful for batch processing and one-time tasks.
  • CronJob - Schedules Jobs to run at specific times; like cron jobs on Unix/Linux.
  • ConfigMap - Stores non-sensitive configuration data as key-value pairs for applications to consume.
  • Secret - Stores sensitive data like passwords, tokens, and API keys in an encrypted manner.
  • PersistentVolume (PV) - Cluster-level storage resource that exists independently of Pods.
  • PersistentVolumeClaim (PVC) - Request for storage; binds a Pod to a PersistentVolume.
  • Namespace - Logical cluster partition for multi-tenancy, isolating resources and access control.
  • Ingress - Manages external HTTP/HTTPS access to Services within the cluster with routing rules.
  • ReplicaSet - Ensures a specified number of Pod replicas are running; typically managed by Deployments.
  • NetworkPolicy - Defines network segmentation and access rules between Pods.
  • RBAC (Role-Based Access Control) - Manages permissions and access control to Kubernetes resources.
  • Kubelet - Node agent that ensures containers run in Pods; communicates with the API server.
  • kube-proxy - Network proxy on each node that maintains network rules for Pod communication.
Further information

Link: Kubernetes

Link: Kubernetes Cheatsheet

Contact: M_Bergmann AT gmx.at