✦ For everyone, free.

Practical knowledge for real and everyday life

Home

1 Kubernetes Foundations

Kubernetes Foundations provides the essential building blocks for deploying, managing, and scaling containerized applications using Kubernetes.

Kubernetes Foundations is the set of conceptual building blocks that underlie the design of Kubernetes, describing the problems the platform solves and the assumptions it makes about how containerized workloads should be run, described, and managed at scale. Understanding these foundations makes the rest of the Kubernetes object model and control-plane behavior legible, since nearly every higher-level feature is a composition of a small number of foundational ideas.


The Problem Kubernetes Solves

From Physical Servers to Containers

Before container orchestration existed, applications were deployed onto physical or virtual machines, requiring manual capacity planning, manual failover, and tight coupling between an application and the machine it ran on. Containers solved packaging and isolation, but running containers reliably across many machines, handling failures, and coordinating updates remained unsolved problems.

Orchestration as the Missing Layer

Kubernetes exists to fill that gap: it treats a group of machines as a single pool of compute capacity and provides a uniform API for describing what should run on that pool, how much of it, and how it should behave when something goes wrong.


Declarative Configuration

Desired State vs. Imperative Commands

Rather than issuing step-by-step imperative commands, Kubernetes users declare a desired end state, such as "three replicas of this application should be running," and the system continuously works to achieve and preserve that state. This declarative approach makes configurations reproducible, version-controllable, and resilient to partial failures.

Idempotency

Because the same declared state can be submitted repeatedly without changing the outcome, declarative configuration is inherently idempotent, which simplifies automation, auditing, and recovery.


Cluster Abstraction

Nodes as Fungible Resources

Kubernetes abstracts away individual machines, referred to as nodes, and instead exposes their aggregate CPU, memory, and storage capacity as a shared pool. Workloads are scheduled onto whichever node has the necessary capacity, rather than being pinned to a specific machine by an operator.

Namespaces

Namespaces provide a mechanism for dividing cluster resources among multiple users, teams, or applications, enabling logical isolation of names and access policies within a single physical cluster.


The API-Centric Model

Everything Is a Resource

Every object in Kubernetes, from a Pod to a node to a configuration value, is represented as a resource with a defined schema, accessible and modifiable through a single, consistent REST API served by the API server.

Labels and Selectors

Labels are key-value pairs attached to resources, and selectors are queries against those labels. This combination allows loosely coupled relationships between objects, such as a Service dynamically finding the set of Pods it should route traffic to based on matching labels rather than hardcoded references.

matching Pods = { p Pods : labels(p) selector }

Self-Healing and Automation

Controllers

A controller is a control loop that watches the shared state of the cluster and makes changes to move the current state toward the desired state. Nearly every automated behavior in Kubernetes, including restarting failed containers, rescheduling Pods from failed nodes, and scaling replica counts, is implemented as a controller.

Health Checks

Liveness and readiness probes give the platform a way to determine whether a container is functioning correctly and whether it is ready to receive traffic, which controllers use as input when deciding whether to restart or reschedule workloads.


Immutable Infrastructure Principles

Kubernetes encourages treating running containers as disposable and replaceable rather than modified in place. Instead of patching a running container, a new container image is built and rolled out, and the old one is terminated. This principle reduces configuration drift and makes deployments easier to reason about and roll back.


Why These Foundations Matter

These foundational concepts, declarative state, cluster abstraction, an API-centric resource model, controller-driven automation, and immutable infrastructure, are not isolated features but a coherent philosophy. Every higher-level Kubernetes capability, from autoscaling to rolling updates to custom operators, is an extension of these same underlying principles applied to a more specific problem.

Content in this section