You type one command, and a few seconds later your application runs somewhere in a cluster. This article follows that request step by step, through every component of Kubernetes, and shows what to look at when one of the steps fails.
kubectl apply -f deployment.yaml looks like a simple command. Behind it, at least six separate programs work together: an API server checks and stores your request, controllers turn it into concrete pods, a scheduler picks a machine, an agent on that machine starts containers, a network plugin gives them an address, and a proxy makes them reachable. None of these programs gives the others orders. Each one watches a shared database and does its own small job.
That design is why Kubernetes heals itself, scales and survives failures. It is also why it can feel like magic when it works and like a maze when it does not. "My pod is stuck in Pending" or "CrashLoopBackOff" only make sense when you know which component is responsible for which step.
According to the CNCF's annual survey, published in January 2026, 82% of organisations that use containers run Kubernetes in production. The sections below follow a single deployment from your terminal to a running, reachable pod: the API server, etcd, controllers, the scheduler, the kubelet, the container runtime, networking, health checks, configuration, security, scaling, updates and shutdown. They build on Docker: Revolutionizing Application Deployment and Scalability, which explains containers, and they connect to Monolith vs. Microservices, which asks whether you need all of this in the first place.
1. The Whole Journey in One Picture
Before going into detail, here is the full path of one deployment. Every arrow is a separate program reacting to a change it has seen.
you ──kubectl apply──> API server ──stores──> etcd
│
watch ───────────┼──────────────────────────────────────────┐
v │
Deployment controller ──creates──> ReplicaSet │
ReplicaSet controller ──creates──> Pod (no node yet) │
Scheduler ──────────────binds────> Pod to node-2 │
│
node-2: kubelet ──CRI──> containerd ──> sandbox, image pull, containers
CNI plugin ──> pod IP 10.42.2.17 CSI ──> volumes
probes pass ──> pod Ready ──> EndpointSlice ──> kube-proxy ──> Service
Three ideas explain almost everything that follows:
- Desired state. You never tell Kubernetes "start this container". You describe the state you want ("three copies of this image should run"), and Kubernetes works towards it.
- Controllers and reconciliation. Small programs compare the desired state with the actual state, again and again, and act on the difference. If a pod disappears, the difference reappears, and a controller creates a new one.
- Watch, not call. The control plane components do not send each other commands. They all watch the API server for changes to the objects they care about, and write their results back to it.
A useful comparison is a thermostat. You set 21 °C. The thermostat does not run a script "heat for ten minutes"; it keeps measuring and switches the heating on whenever the room is colder than the target. Kubernetes runs hundreds of such thermostats, one for each kind of object.
2. A Short History
| Year | Event |
|---|---|
| 2003–2004 | Google builds Borg, its internal cluster manager, which later inspires Kubernetes |
| 2013 | Docker makes containers easy to build and ship |
| Jun 2014 | Google announces Kubernetes as an open-source project |
| Jul 2015 | Kubernetes 1.0; Google donates it to the newly founded Cloud Native Computing Foundation (CNCF) |
| 2015–2018 | Managed Kubernetes arrives: Google GKE, then Azure AKS and Amazon EKS |
| Mar 2018 | Kubernetes becomes the first project to graduate from the CNCF |
| May 2022 | Kubernetes 1.24 removes "dockershim": nodes now run containers only through the Container Runtime Interface |
| Apr 2025 | Kubernetes 1.33: native sidecar containers and the nftables mode of kube-proxy become stable |
| Dec 2025 | Kubernetes 1.35: CPU and memory of running pods can be resized in place (stable) |
| Mar 2026 | The community Ingress NGINX controller is retired; Gateway API is the recommended successor |
| Apr 2026 | Kubernetes 1.36: user namespaces for pods become stable; version 1.37 follows later in the year |
The name is Greek for "helmsman" or "pilot", which is why the logo is a ship's wheel. "K8s" is a shortened form: K, eight letters, s. New minor versions appear about three times a year, and each one is supported with patches for about fourteen months, so a cluster has to be upgraded regularly.
3. The Vocabulary
| Term | Meaning |
|---|---|
| Cluster | A set of machines managed together by one Kubernetes control plane |
| Node | One machine (virtual or physical) that runs your workloads |
| Control plane | The components that make decisions: API server, etcd, scheduler, controller manager |
| Pod | The smallest unit Kubernetes runs: one or more containers that share a network address and can share volumes |
| Deployment | Describes a stateless application: which image, how many copies, how to update it |
| ReplicaSet | Keeps a fixed number of identical pods running; created and managed by a Deployment |
| Service | A stable name and address in front of a changing group of pods |
| Namespace | A folder for objects, used to separate teams, apps or environments |
| Label | A key-value tag on an object (app: orders-api); selectors use labels to find objects |
| kubelet | The agent on every node that starts and watches the pods assigned to it |
| Container runtime | The software that actually runs containers, usually containerd or CRI-O |
| CNI plugin | Gives every pod a network address and connects it to the cluster network |
| CSI driver | Attaches and mounts storage volumes for pods |
Two more words appear everywhere: manifest means a YAML file that describes objects, and workload means anything that runs pods (Deployments, StatefulSets for databases, DaemonSets for one pod per node, Jobs for one-off tasks).
4. Step 1: You Describe What You Want
Everything starts with a file. Here is a small but realistic Deployment for an example API:
apiVersion: apps/v1
kind: Deployment
metadata:
name: orders-api
namespace: shop
spec:
replicas: 3
selector:
matchLabels:
app: orders-api
template:
metadata:
labels:
app: orders-api
spec:
containers:
- name: api
image: registry.example.com/orders-api:1.8.2
ports:
- containerPort: 8080
resources:
requests:
cpu: 250m
memory: 256Mi
limits:
memory: 512Mi
readinessProbe:
httpGet:
path: /health/ready
port: 8080
It says: run three copies of orders-api:1.8.2. Each needs a quarter of a CPU core (250m means 250 millicores) and 256 MiB of memory to be scheduled, may never use more than 512 MiB, and is only ready for traffic when /health/ready answers. The selector tells the Deployment which pods belong to it: all pods with the label app: orders-api.
When you run:
kubectl apply -f deployment.yaml
kubectl reads your credentials from ~/.kube/config, turns the YAML into JSON and sends it over HTTPS to the cluster's API server. That is all it does. kubectl never talks to a node.
A detail that matters in teams: apply remembers which fields you set. When you apply the file again later, Kubernetes changes only those fields and leaves fields set by other tools alone, for example the replica count managed by an autoscaler. This is called server-side apply, and every change records a "field manager" that owns it.
5. Step 2: The API Server Checks and Stores
The API server is the front door of the cluster and the only component that talks to the database. Every request passes through the same stages:
- Authentication: who are you? A client certificate, a token from your cloud provider or an OpenID Connect login.
- Authorisation: may you do this? Usually RBAC rules such as "the team
checkoutmay create Deployments in namespaceshop". - Mutating admission: policies may change the object, for example add default labels, inject a sidecar or set a missing security setting.
- Validation: is the object well-formed? Unknown fields, wrong types and impossible values are rejected here.
- Validating admission: policies may reject it, for example "images must come from our own registry" or "containers must not run as root".
- Storage: the object is written to etcd.
Admission policies used to require a separate web service (a "webhook") that the API server called for every request. Today many rules can be written directly as policies inside the cluster, in a small expression language called CEL, which is faster and has one moving part less.
etcd: the cluster's memory
etcd is a small, strongly consistent key-value store. It usually runs on three or five machines and uses the Raft protocol: a write only counts when a majority of them has stored it. That is why three etcd members survive the loss of one, and five survive the loss of two. If etcd loses its majority, the cluster stops accepting changes; running pods keep running, but nothing new can be scheduled.
Every object in etcd has a resourceVersion, a number that grows with every change. It solves a classic problem: two controllers read the same object, both change it, both write it back. The API server only accepts a write if the resourceVersion is still the one the writer read. The second writer gets a conflict, reads again and retries. This is called optimistic concurrency, and it is why Kubernetes needs no locks.
After this step, the API server answers deployment.apps/orders-api created. Notice what has happened so far: nothing is running yet. Your desired state is stored. Everything else happens asynchronously.
6. Step 3: Controllers Turn Wishes into Pods
The controller manager runs dozens of controllers, each responsible for one kind of object. They all follow the same loop:
loop forever:
desired = what the objects say
actual = what exists right now
if actual != desired:
do the smallest thing that moves actual towards desired
Controllers do not poll the database. They open a long-lived watch connection to the API server and receive every change as an event. A local cache (an "informer") keeps a copy of the objects, so a controller can look things up without asking the API server each time. If a controller misses events, for example after a restart, it simply lists everything again and compares: the design tolerates lost messages.
For our deployment, two controllers react one after the other:
- The Deployment controller sees a new Deployment without a ReplicaSet. It creates a ReplicaSet for this exact pod template (image 1.8.2), with
replicas: 3. It adds a labelpod-template-hashwith a hash of the template, so pods from different versions never get mixed up. - The ReplicaSet controller sees a ReplicaSet that wants three pods and finds zero. It creates three Pod objects, with names like
orders-api-7d9c5f6b8-x2kqp.
These pods exist only as records in etcd. Their field nodeName is empty: no machine has been chosen yet. Their status is Pending.
Every created object points to its creator with an owner reference: pod → ReplicaSet → Deployment. Delete the Deployment, and the garbage collector removes the ReplicaSets and pods that belong to it. Delete a single pod, and the ReplicaSet notices that it has only two and creates a replacement. That is self-healing, and it is nothing more than this loop.
Why the extra ReplicaSet layer? Because of updates. When you change the image to 1.8.3, the Deployment controller creates a second ReplicaSet and slowly shifts the pod count from the old one to the new one (section 11). The old ReplicaSet stays around with zero pods, which makes kubectl rollout undo a matter of seconds.
The control plane itself is usually replicated across three machines. Several copies of the controller manager and the scheduler run at the same time, but only one of each is active: they hold a lease in the API server, and if the leader stops renewing it, another copy takes over within seconds.
7. Step 4: The Scheduler Picks a Node
The scheduler watches for pods without a node. For each one it runs two phases.
Filtering removes every node that cannot run the pod:
- not enough free CPU or memory for the pod's requests (not its actual use: the scheduler only counts requests)
- a taint on the node that the pod does not tolerate, for example "only GPU workloads here"
- affinity rules, such as "only nodes in zone eu-central-1a" or "not on the same node as another copy of me"
- a required port, volume or zone that the node cannot offer
Scoring ranks the nodes that are left: spread copies across zones and nodes, prefer nodes that already have the image, balance the load. The node with the highest score wins. Both phases are made of small plugins, so platforms can add their own rules.
The scheduler then writes one small change to the API server: a binding that sets nodeName: node-2. It does not start anything itself.
Spreading copies on purpose
Three copies on the same machine are one hardware failure away from zero. A spread constraint tells the scheduler to distribute them:
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app: orders-api
With three zones, each zone gets one copy, and the difference between zones may never be larger than one.
When nothing fits
If no node passes the filters, the pod stays Pending, and the scheduler records the reason as an event:
Warning FailedScheduling 0/5 nodes are available: 3 Insufficient memory,
2 node(s) had untolerated taint {gpu: true}.
This message is the first place to look when a pod never starts. Two mechanisms can still help:
- Preemption: pods have a priority. If an important pod cannot be placed, the scheduler may evict pods with a lower priority to make room.
- Autoscaling: a cluster autoscaler (or a tool such as Karpenter) sees the pending pod and adds a new node that fits it, usually within a minute or two.
8. Step 5: The Kubelet Starts the Containers
On every node runs the kubelet. It watches the API server for pods assigned to its own node. When it sees one of ours, the real work begins.
- Pod sandbox. The kubelet asks the container runtime, through the Container Runtime Interface (CRI), to create a sandbox: a set of Linux namespaces that all containers of the pod will share. A tiny "pause" container holds the network namespace open.
- Network. The runtime calls the CNI plugin (Calico, Cilium, Flannel or your cloud's plugin). It gives the pod its own IP address, for example
10.42.2.17, and connects it to the cluster network. By default, every pod can reach every other pod by IP, without NAT. - Volumes. Config maps, secrets and persistent volumes are mounted, the latter through a CSI driver that attaches a cloud disk or network storage.
- Image pull. The runtime pulls
orders-api:1.8.2from the registry, unless the node already has it. WithimagePullPolicy: Alwaysit checks the registry every time; with a fixed version tag, the default is to reuse a cached image. - Init containers run one after the other, for example to wait for a database or run a migration. Sidecars, helper containers such as a log shipper or a proxy, are declared in the same list: they start in their turn and keep running for as long as the pod does.
- App containers start. The kubelet reports the pod as
Running.
What a container really is
A container is not a small virtual machine. It is a normal Linux process with two kinds of fences:
- Namespaces decide what the process can see: its own process list, its own network interfaces and IP address, its own file system view, its own host name. Since Kubernetes 1.36, user namespaces are stable too: with
hostUsers: false, "root" inside the container is an unprivileged user on the node, which makes a container escape far less dangerous. - cgroups decide how much it can use: CPU time, memory, process count. The requests and limits from the Deployment become cgroup settings here.
The runtime itself is usually containerd or CRI-O. Since Kubernetes 1.24, Docker Engine is no longer built in as a node runtime, but the images you build with Docker run unchanged: they follow the same OCI standard.
Phases and conditions
The kubelet reports progress back to the API server. A pod has a coarse phase and a list of finer conditions:
| Condition | True when |
|---|---|
PodScheduled | The scheduler has bound the pod to a node |
Initialized | All init containers have finished |
ContainersReady | All containers are running and pass their readiness probes |
Ready | The pod may receive traffic from Services |
The phase is one of Pending, Running, Succeeded, Failed or Unknown. For a quick look, kubectl get pod shows a short summary; kubectl get pod -o yaml shows every condition with the time it last changed.
9. Step 6: Healthy, Ready and Reachable
Running only means the process started. Whether the pod should receive traffic is decided by probes, which the kubelet runs regularly:
| Probe | Question | If it fails |
|---|---|---|
| Startup | Has the application finished starting? | The other probes wait; after too many failures the container is restarted |
| Readiness | Can it handle requests right now? | The pod is taken out of the load balancer, but not restarted |
| Liveness | Is it still alive, or stuck? | The container is restarted |
A typical setup for a Java or Node.js service that needs some time to start:
startupProbe:
httpGet: { path: /health/started, port: 8080 }
periodSeconds: 5
failureThreshold: 24 # up to 2 minutes to start
readinessProbe:
httpGet: { path: /health/ready, port: 8080 }
periodSeconds: 5
livenessProbe:
httpGet: { path: /health/live, port: 8080 }
periodSeconds: 10
failureThreshold: 3
Keep the liveness check simple: "is the process able to answer at all?". If it also checks the database, a short database outage makes Kubernetes restart every pod at once, which turns a small problem into a big one.
Services: one stable address
Pods come and go, and every new pod gets a new IP address. A Service gives a group of pods one address that does not change:
apiVersion: v1
kind: Service
metadata:
name: orders-api
namespace: shop
spec:
selector:
app: orders-api
ports:
- port: 80
targetPort: 8080
When the readiness probe passes, the pod's condition becomes Ready, and the networking side reacts:
- The EndpointSlice controller adds the ready pod's IP to the list of endpoints behind the Service.
- kube-proxy on every node watches those lists and programs the kernel (with iptables or, since 1.33 as a stable option, nftables rules), so that traffic to the Service's virtual IP is spread across the ready pods. Some network plugins, such as Cilium, replace kube-proxy and do the same with eBPF.
- CoreDNS answers the name
orders-api.shop.svc.cluster.localwith the Service IP, so other applications never need pod addresses. Inside the same namespace,orders-apialone is enough. The DNS article explains how such names are resolved.
| Service type | Reachable from | Typical use |
|---|---|---|
ClusterIP (default) | Inside the cluster only | Service-to-service calls |
NodePort | A fixed port on every node | Simple setups, testing |
LoadBalancer | A cloud load balancer with a public or private IP | One service exposed directly |
Traffic from outside: Gateway API
For HTTP traffic from the internet, one load balancer usually serves many services, routed by host name and path. The modern way to describe this is Gateway API. The platform team defines a Gateway (the entry point with its TLS certificate), and each application team adds routes:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: orders
namespace: shop
spec:
parentRefs:
- name: public-gateway
namespace: infra
hostnames: ["shop.example.com"]
rules:
- matches:
- path: { type: PathPrefix, value: /api/orders }
backendRefs:
- name: orders-api
port: 80
The older Ingress resource still works with maintained controllers, but its most popular community implementation, Ingress NGINX, was retired in March 2026, and new setups should start with Gateway API.
10. Watching It Happen
You can follow the whole journey in the cluster's events. Here is what a successful deployment of one pod typically looks like (names and timings are examples):
$ kubectl get events -n shop --sort-by=.lastTimestamp
12s Normal ScalingReplicaSet deployment/orders-api Scaled up replica set orders-api-7d9c5f6b8 to 3
12s Normal SuccessfulCreate replicaset/orders-api-7d9c… Created pod: orders-api-7d9c5f6b8-x2kqp
12s Normal Scheduled pod/orders-api-7d9c…-x2kqp Successfully assigned shop/orders-api-7d9c5f6b8-x2kqp to node-2
11s Normal Pulling pod/orders-api-7d9c…-x2kqp Pulling image "registry.example.com/orders-api:1.8.2"
6s Normal Pulled pod/orders-api-7d9c…-x2kqp Successfully pulled image in 4.8s
6s Normal Created pod/orders-api-7d9c…-x2kqp Created container: api
6s Normal Started pod/orders-api-7d9c…-x2kqp Started container api
Read it from top to bottom and you see each component of this article at work: the Deployment controller, the ReplicaSet controller, the scheduler and the kubelet with the runtime. The pod becomes ready a few seconds later, when the application has started and the readiness probe passes.
In a healthy cluster with the image already on the node, the whole journey from kubectl apply to a ready pod takes a few seconds. An image pull of several hundred megabytes or a slow application start often takes longer than everything else together. Small images and a fast start pay off every time a pod is created, which on a busy cluster happens thousands of times a day.
11. Updates and Shutdown
Rolling updates
Change the image to 1.8.3 and apply again. The Deployment controller creates a new ReplicaSet and moves pods over in small steps, controlled by two settings:
maxSurge: how many extra pods may exist during the update (default 25%)maxUnavailable: how many pods may be missing (default 25%)
A new pod must become ready before an old one is removed. That is why a good readiness probe is not optional: without one, Kubernetes sends traffic to pods that are still starting, and a broken version can replace a working one completely. You can watch and control a rollout:
kubectl rollout status deployment/orders-api -n shop # waits until the rollout is done
kubectl rollout undo deployment/orders-api -n shop # back to the previous ReplicaSet
During node maintenance or cluster upgrades, pods are moved away from a node ("drained"). A PodDisruptionBudget such as minAvailable: 2 makes sure that this never takes down more copies at once than your service can tolerate.
Graceful shutdown
When a pod is removed, Kubernetes follows a fixed order:
1. Pod is marked as terminating → removed from the Service endpoints
2. preStop hook runs (if defined)
3. Container receives SIGTERM → the application should finish open requests and exit
4. After the grace period (default 30 s): SIGKILL
Steps 1 and 3 happen at nearly the same time, and the endpoint update needs a moment to reach every node. An application that exits the instant it gets SIGTERM can still receive a few requests and fail them. Common practice: keep serving for a few seconds after SIGTERM (or add a short pause in a preStop hook), stop accepting new connections, then finish. The retry article shows what clients should do with the requests that still fail.
12. Configuration and Security
Config maps and secrets
Images should be the same in every environment; what differs is configuration. Kubernetes keeps it outside the image:
- A ConfigMap holds settings such as feature flags, URLs or a whole configuration file.
- A Secret holds passwords, tokens and keys.
Both can be passed to a container as environment variables or mounted as files. Mounted files are updated when the object changes; environment variables only when the pod restarts.
One fact surprises many people: the values of a Secret are only base64-encoded, not encrypted. Anyone allowed to read Secrets in a namespace can read the passwords. Protect them with strict RBAC, turn on encryption at rest for etcd, and for sensitive environments keep the real secrets in an external vault and sync them in.
A secure default for every container
Most containers need far fewer rights than they get by default. A strict security context costs nothing and removes whole classes of attacks:
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
seccompProfile:
type: RuntimeDefault
Kubernetes can enforce such rules per namespace with Pod Security Standards: the label pod-security.kubernetes.io/enforce: restricted rejects every pod that does not follow them.
Network policies
By default, every pod may talk to every other pod. A NetworkPolicy turns that into an allow list, for example "only pods of the checkout app may call the orders API on port 8080":
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: orders-api-ingress
namespace: shop
spec:
podSelector:
matchLabels:
app: orders-api
policyTypes: ["Ingress"]
ingress:
- from:
- podSelector:
matchLabels:
app: checkout
ports:
- port: 8080
Network policies are enforced by the CNI plugin, so check that yours supports them. A policy that the plugin ignores protects nothing.
13. Resources and Scaling
Requests, limits and fair sharing
Resources are where many production surprises come from, because CPU and memory behave differently.
- Requests are what the scheduler reserves. A pod with
cpu: 250mgets a quarter of a core guaranteed, even when the node is busy. - CPU limits cap the CPU time. A container that hits its limit is slowed down (throttled), not stopped. Many teams set CPU requests but no CPU limits, so idle capacity is not wasted.
- Memory limits are hard. A container that goes over is killed (
OOMKilled). Memory cannot be throttled.
From requests and limits, Kubernetes derives a quality-of-service class for each pod. It decides who is removed first when a node runs short:
| Class | When | Evicted |
|---|---|---|
| Guaranteed | Requests equal limits for CPU and memory in every container | Last |
| Burstable | At least one request or limit set, but not Guaranteed | In between |
| BestEffort | No requests and no limits at all | First |
Two practical rules: set memory requests and limits close to the real use, measured over time, and never run important workloads as BestEffort.
Three ways to scale
| Tool | Changes | Reacts to |
|---|---|---|
| Horizontal Pod Autoscaler (HPA) | The number of pods | CPU, memory or custom metrics such as requests per second or queue length |
| Vertical Pod Autoscaler (VPA) | The requests and limits of each pod | The measured use over time |
| Cluster autoscaler or Karpenter | The number of nodes | Pods that cannot be scheduled, and nodes that are nearly empty |
An HPA for our API, which keeps the average CPU use around 70% of the requested CPU:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: orders-api
namespace: shop
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: orders-api
minReplicas: 3
maxReplicas: 20
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
The HPA works on the percentage of the request, which is one more reason to set requests realistically. Since Kubernetes 1.35, the CPU and memory of a running pod can also be changed in place, without a restart, which makes vertical scaling much less disruptive than before.
14. When It Goes Wrong
Most problems show up as a pod status. Each one points to the component that failed.
| Status | What it means | Where to look |
|---|---|---|
Pending | No node fits, or a volume cannot be attached | Scheduler events in kubectl describe pod |
ErrImagePull, ImagePullBackOff | The image name, tag or registry login is wrong | Image name and the pull secret |
CreateContainerConfigError | A ConfigMap or Secret the pod needs does not exist | Names of the referenced ConfigMaps and Secrets |
CrashLoopBackOff | The container starts and exits again and again | kubectl logs --previous; Kubernetes waits longer before each restart, up to five minutes |
OOMKilled (exit code 137) | The container used more memory than its limit | Memory limit and the application's real use |
Running, but not Ready | The readiness probe fails | Probe path, port and timing |
Evicted | The node ran out of memory or disk and removed pods | Node pressure, requests that are set too low |
Terminating for a long time | The process ignores SIGTERM, or a finalizer waits for something | Shutdown handling in the app, metadata.finalizers |
Five commands cover most investigations:
kubectl get pods -n shop -o wide # status, restarts, node, pod IP
kubectl describe pod orders-api-7d9c5f6b8-x2kqp -n shop # events: scheduling, pulls, probes
kubectl logs orders-api-7d9c5f6b8-x2kqp -n shop --previous # output of the crashed container
kubectl get events -n shop --sort-by=.lastTimestamp # everything that happened, in order
kubectl debug -it orders-api-7d9c5f6b8-x2kqp -n shop --image=busybox # a shell next to a minimal container
The last one is useful for small images without a shell: it adds a temporary debug container to the running pod, so you can look at its network and files without rebuilding the image.
A simple way to debug is to walk the chain of this article backwards. Is the Service sending traffic? Check its endpoints (kubectl get endpointslices -n shop). No endpoints? The pods are not ready: check the probes. Not running? Check the events: image, config, scheduling. For anything deeper, metrics, logs and traces belong in a proper observability setup, as described in Observability in Distributed Systems.
15. Honest Limits
- Kubernetes is complex. A dozen components, hundreds of settings, and a large ecosystem around them. For one application on two servers, a managed container service or a plain virtual machine is often the better choice. The monolith article explains why architecture should follow the team, not the trend.
- YAML grows quickly. Real applications need Deployments, Services, routes, config, secrets, policies and autoscaling. Teams end up with templates (Helm, Kustomize) and GitOps tools such as Argo CD or Flux to keep it manageable.
- Defaults are not secure enough. Network policies, Pod Security Standards, RBAC and image policies must be set up deliberately.
- State is harder than stateless. Databases on Kubernetes work, but need operators, persistent volumes and backups that are tested, not assumed.
- Running the control plane is real work. Upgrades several times a year, etcd backups, certificates. Managed services (GKE, EKS, AKS and others) take most of this away.
- Costs hide easily. Requests that are set too high reserve capacity that nobody uses, and idle nodes keep running. Without measuring, clusters often run at a small fraction of what they pay for.
- The ecosystem moves. The retirement of the widely used Ingress NGINX controller in March 2026 forced many teams into a migration to Gateway API. Plan for such changes.
16. Conclusion
Deploying a pod is not one action but a chain of small, independent reactions, each by a component that watches the API server and does one job.
- Desired state: you describe what you want; controllers keep comparing it with reality and close the gap.
- API server and etcd: every change is authenticated, authorised, checked by admission policies and stored with a version number; nothing runs at this point.
- Controllers: a Deployment creates a ReplicaSet, which creates pods; owner references and the reconcile loop make self-healing, rolling updates and rollbacks possible.
- Scheduler: filters nodes by requests, taints and affinity, scores the rest and binds the pod.
- Kubelet and runtime: create the sandbox, network, volumes and containers through CRI, CNI and CSI; namespaces and cgroups fence each container in.
- Probes, Services and Gateways: only ready pods receive traffic, through a stable Service address, a DNS name and, from outside, a Gateway route.
- Operations: realistic requests, a strict security context, network policies, autoscaling and graceful shutdown turn a running pod into a reliable service.
- Troubleshooting: the pod status tells you which step failed;
kubectl describeand the events tell you why.
Next time a pod is stuck, do not guess. Run kubectl describe pod, read the events from top to bottom, and find the step in this chain where it stopped.
Sources and Further Reading
- Kubernetes documentation, Kubernetes Components: https://kubernetes.io/docs/concepts/overview/components/
- Kubernetes documentation, Deployments: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
- Kubernetes documentation, Kubernetes Scheduler: https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/
- Kubernetes documentation, Pod Lifecycle: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/
- Kubernetes documentation, Liveness, Readiness and Startup Probes: https://kubernetes.io/docs/concepts/configuration/liveness-readiness-startup-probes/
- Kubernetes documentation, Sidecar Containers: https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/
- Kubernetes documentation, Resource Management for Pods and Containers: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
- Kubernetes documentation, Horizontal Pod Autoscaling: https://kubernetes.io/docs/concepts/workloads/autoscaling/horizontal-pod-autoscale/
- Kubernetes documentation, Pod Security Standards: https://kubernetes.io/docs/concepts/security/pod-security-standards/
- Kubernetes documentation, Network Policies: https://kubernetes.io/docs/concepts/services-networking/network-policies/
- Kubernetes documentation, Good practices for Kubernetes Secrets: https://kubernetes.io/docs/concepts/security/secrets-good-practices/
- Kubernetes blog, "Kubernetes v1.33: Octarine", April 2025: https://kubernetes.io/blog/2025/04/23/kubernetes-v1-33-release/
- Kubernetes blog, "Kubernetes 1.35: In-Place Pod Resize Graduates to Stable", December 2025: https://kubernetes.io/blog/2025/12/19/kubernetes-v1-35-in-place-pod-resize-ga/
- Kubernetes blog, "Kubernetes v1.36: User Namespaces in Kubernetes are finally GA", April 2026: https://kubernetes.io/blog/2026/04/23/kubernetes-v1-36-userns-ga/
- Kubernetes blog, "Dockershim Removal FAQ", 2022: https://kubernetes.io/blog/2022/02/17/dockershim-faq/
- Kubernetes blog, "Ingress NGINX Retirement: What You Need to Know", November 2025: https://kubernetes.io/blog/2025/11/11/ingress-nginx-retirement/
- Gateway API: https://gateway-api.sigs.k8s.io/
- CNCF, The CNCF Annual Cloud Native Survey 2025, January 2026: https://www.cncf.io/reports/the-cncf-annual-survey-2025/
- A. Verma et al., "Large-scale cluster management at Google with Borg", EuroSys 2015: https://research.google/pubs/large-scale-cluster-management-at-google-with-borg/




