FIELD GUIDE 09Infrastructure and security

kubernetes / kubernetes

Kubernetes is a control system, not a shortcut to running containers

The famous repository rewards a slower reading. Its real subject is a durable API for declaring operational intent, then reconciling clusters toward that intent through many cooperating control loops.

WHAT TO KNOW FIRST

  1. The durable idea in Kubernetes is its declarative API plus reconciliation loops. Containers are the workload unit, but control is the product.
  2. The extension model is a major source of value and risk. Custom resources and controllers can create a coherent internal platform, or an ecosystem that nobody can safely upgrade.
  3. A successful cluster needs operating ownership beyond application deployment, including upgrades, identity, networking, storage, monitoring and recovery.

01Start with the system, not the logo

The kubernetes/kubernetes repository contains the core of a distributed control system. It is not a polished single binary that simply starts a container on demand. The official component model separates the control plane from the machines that run workloads. The API server exposes the Kubernetes API, etcd stores API data, the scheduler assigns unscheduled Pods to nodes, and controller managers run control loops. On each node, the kubelet works to keep the Pods assigned to that node running through a container runtime.

That division explains both the power and the cost. A user submits an object that describes a desired result, such as three replicas of an application. Several components then cooperate to make observed cluster state match the declaration. The design gives operators a stable place to express intent even as individual processes, containers and machines change. It also means that a production incident can cross API admission, scheduling, networking, storage, node health and application behavior. Reading the repository as a control plane prevents the common mistake of evaluating it as a more elaborate process manager.

02Desired state is the central contract

Kubernetes objects are persistent statements about the cluster. Their specifications describe a desired state, while status fields report what the system currently observes. Controllers watch relevant objects, compare the two and take steps toward convergence. This reconciliation pattern is why replacement Pods can appear after a failure and why changing a Deployment can initiate a rollout without an operator issuing a command for every container. The API becomes the record of operational intent, not merely a remote control surface.

The model is deliberately level based. A controller cares about the current desired result rather than depending on every prior event being delivered exactly once. That property helps a distributed system recover after restarts and temporary communication failures. It does not make the application correct by itself. A controller can keep the requested number of Pods present while those Pods fail readiness checks, serve incorrect data or depend on an unavailable external system. Kubernetes can reconcile the resources represented in its API; teams still have to define useful health signals and design applications that tolerate replacement and delay.

03The workload abstractions are layered on purpose

A Pod is the smallest deployable Kubernetes object and can contain one or more tightly coupled containers. Most application teams should not manage individual Pods directly. A Deployment manages ReplicaSets and supplies declarative updates for stateless workloads. StatefulSet adds stable identity and ordered behavior for certain stateful applications. DaemonSet targets a Pod to applicable nodes, while Job and CronJob represent work that should complete rather than remain continuously available. These resources encode different operating semantics, not cosmetic naming preferences.

Services and related networking resources provide stable discovery in front of changing Pods. PersistentVolume and PersistentVolumeClaim objects separate a workload's storage request from a specific storage implementation. ConfigMaps and Secrets supply configuration data, although a Secret object is not automatically a complete secrets-management program. Each abstraction removes some direct machine management, but each also creates a contract that the cluster environment must fulfill. A storage class, network implementation or ingress controller can determine whether the same manifest behaves as expected on another cluster.

  • Use Deployment for replaceable stateless replicas and understand its rollout behavior.
  • Choose StatefulSet only when stable identity or ordered operation is part of the workload contract.
  • Treat Service discovery, storage classes and ingress behavior as platform capabilities that need explicit ownership.

04Scheduling is policy meeting available capacity

The scheduler watches for Pods without an assigned node, filters nodes that cannot satisfy their requirements and scores the feasible choices. Requests and limits, affinity rules, topology constraints, taints, tolerations and priority can all influence placement. This vocabulary lets a platform express hardware needs, failure-domain preferences and workload separation. It also creates a policy surface where one inaccurate resource request can waste capacity or leave a workload pending even though a dashboard appears to show free resources.

Kubernetes reschedules work after node and process failures, but that statement needs precision. It can create replacement Pods and attach declared resources according to the controllers and storage system involved. It cannot recover data that was never made durable, prove that a replacement is safe, or make an application instantly available during every dependency failure. Pod disruption budgets, readiness probes, rollout strategy and topology distribution help express availability intent. Their effectiveness depends on realistic capacity and an application that can run multiple instances without corrupting shared state.

05Extensibility is where clusters become platforms

The API machinery is designed to be extended. CustomResourceDefinitions add new resource types, and custom controllers reconcile those resources. Admission controllers can validate or mutate requests. The container, networking and storage interfaces connect the core system to implementation choices. This is how a cluster can grow from a workload scheduler into a company-specific platform with database operators, certificate management, policy checks and deployment conventions represented as APIs.

Extensions also compound maintenance risk. A controller may introduce its own webhooks, permissions, custom resources, upgrade sequence and failure modes. Two operators may compete over the same underlying object. An admission webhook that is unavailable can block API operations depending on its configuration. The official API deprecation policy provides important stability commitments for Kubernetes itself, but it cannot guarantee the quality of every add-on. A useful platform catalog therefore records owners, supported versions, permissions, recovery steps and an exit plan for every extension installed in the cluster.

06Security begins at the API boundary

Kubernetes security is a chain of decisions. Requests reach the API server, pass authentication, authorization and admission, then may create workloads with access to service accounts, Secrets, volumes and network destinations. Role-based access control can narrow permissions, while namespaces provide a scope for names and policies but are not, by themselves, a hard multi-tenant boundary. Pod security controls, network policies and carefully scoped service accounts help reduce exposure when the chosen cluster components enforce them.

The repository is Apache-2.0 licensed, but open source licensing does not transfer operational responsibility. Cluster administrators must patch supported versions, protect etcd and credentials, restrict administrative paths and understand the privileges granted to controllers. Container isolation also depends on the host kernel, runtime and workload configuration. A cluster that accepts privileged Pods or mounts sensitive host paths deliberately weakens boundaries. The safest evaluation asks what a compromised workload can reach, which credentials it receives, and which control-plane actions those credentials authorize.

07Day two is the real product evaluation

A demonstration cluster can make deployment look like the whole job. Production ownership starts after that moment. The official production guidance calls out availability, scale, security and operational choices. Teams need an upgrade policy for control-plane and node versions, a tested path for backing up and restoring relevant state, certificate and credential rotation, capacity management, log and metric retention, and a way to diagnose failures when the API itself is degraded.

Version skew rules and API removals make release notes operational material. Managed Kubernetes reduces control-plane work, but it does not remove node upgrades, add-on compatibility, workload disruption or cost management. Self-managed clusters expose even more of the machinery. A sensible adoption proposal should name the tasks that the provider handles and the tasks that remain with the team. Without that boundary, Kubernetes can create the appearance of a standard platform while every cluster quietly accumulates unique networking, policy and upgrade assumptions.

08When the complexity earns its place

Kubernetes fits when a team repeatedly needs declarative rollout, service discovery, placement, replacement, workload isolation and an extensible infrastructure API across enough applications to justify a shared platform. It is especially useful when platform engineers can turn those primitives into paved paths for application teams. The payoff is not that every developer learns every object. The payoff is that common operating decisions become reviewed, automated and observable interfaces.

It is a poor default when one or two services can run reliably on a managed application platform, a container service or a small set of virtual machines. In that setting, the cluster may add a second distributed system before the product has a distributed-systems problem. Compare alternatives on recovery objectives, release frequency, isolation, portability and team ownership, not on whether Kubernetes appears in an architecture diagram. The right decision can be to postpone it and preserve an application design that remains portable later.

09A productive route through the repository

The root repository points users toward the official documentation and contributors toward development material. For architecture reading, begin with the component descriptions, then trace one API object. Follow how its types are defined, how clients submit it, which controller watches it and how node-level behavior eventually reflects it. This vertical path is more useful than browsing directories alphabetically because the codebase is large and reflects years of compatibility obligations.

Release notes and enhancement proposals supply context that source files alone cannot. They explain feature maturity, migration and the design tradeoffs behind changes. The community publishes governance and contribution processes because Kubernetes is not maintained as a private product with a single hidden roadmap. That openness makes the repository unusually educational, but the volume can overwhelm casual readers. Choose one operational question, such as rollout, scheduling or admission, and use the official concepts as a map before opening implementation code.

A SENSIBLE FIRST HOUR

Start small enough to learn the repo

  1. Read the official Concepts overview and Components page before choosing a local cluster tool. Learn what the API server, scheduler, controller manager, kubelet and container runtime each own.
  2. Use an officially documented learning environment to deploy one small stateless application. Inspect the Deployment, ReplicaSet, Pod and Service objects created along the way.
  3. Change one declared value, such as the replica count or image tag, then observe how the control plane reports and reconciles the new desired state.
  4. Before considering production, write down who will own upgrades, identity, network policy, persistent storage, backups, observability and incident response. Treat every blank owner as a deployment blocker.

SOURCE LEDGER

What this review is built on

We use the project repository and first-party documentation. Access, licenses and project direction can change, so recheck the linked source before making a production decision.

  1. kubernetes/kubernetes repositoryrepository
  2. Kubernetes componentsdocumentation
  3. Kubernetes production environment guidancedocumentation
  4. Kubernetes releasesrelease
  5. Apache 2.0 licenselicense