From Docker to Kubernetes: single instance vs. many replicas
With Docker you can run a single instance of an application usingdocker run. Kubernetes extends that idea so you can declare the desired state (the container image, number of replicas, update strategy, etc.) in a Deployment, and Kubernetes automatically makes reality match that desired state across the cluster.
Example: start one container with Docker:
Be mindful of cluster capacity and resource limits. Kubernetes will attempt to schedule the specified number of replicas and can fail or become unstable if the cluster lacks resources.
Kubernetes cluster architecture — control plane and nodes
A Kubernetes cluster is a set of machines called nodes. Each node is a physical or virtual machine that runs containers. To tolerate node failures you run multiple nodes; together they form a cluster. The cluster is managed by the control plane (also called the master). The control plane components track cluster state, make scheduling decisions, and react to failures.
Control plane components
The main control-plane components you’ll encounter are:- API server — the front end for the control plane; all clients and tools (including
kubectl) interact with the cluster via the API server. - etcd — a distributed key-value store that persists cluster state (nodes, pods, configs) reliably.
- Scheduler — assigns new Pods to nodes based on resource requests, constraints, and available capacity.
- Controllers — reconciliation loops that observe the current state and take actions to reach the desired state (e.g., replacing failed Pods).

Node components
Each worker node runs:- kubelet — an agent that registers the node with the control plane and ensures containers described in Pods are running and healthy.
- Container runtime — the software that actually runs containers (commonly containerd or CRI‑O).
- Optionally: kube-proxy or other networking components to implement Services and network rules.

How Kubernetes interacts with container runtimes (Docker and CRI)
Kubernetes communicates with container runtimes through the Container Runtime Interface (CRI). Historically, many nodes used Docker Engine, and Kubernetes relied on a shim (dockershim) or an externalcri-dockerd bridge to talk to Docker. Since Kubernetes v1.24 (April 2022) dockershim was removed from the core codebase, so Kubernetes no longer includes native Docker Engine support; cri-dockerd can still be used where Docker compatibility is required.
Important details:
- Docker Engine itself delegates container execution to containerd (and containerd uses runc). Kubernetes can talk directly to containerd or other CRI-compliant runtimes, so the removal of dockerd did not stop workloads from running.
- Common CRI runtimes:
containerd,CRI‑O. If you need Docker Engine compatibility, use the externalcri-dockerdadapter.

kubectl — the Kubernetes CLI
kubectl is the primary command-line tool used to interact with a cluster: deploy applications, inspect resources, and perform cluster administration tasks.
Common kubectl commands:
Example interactive session:
kubectl surfaces the cluster state.
Quick summary
- Kubernetes runs and manages containers at scale using a control plane (API server, etcd, scheduler, controllers) and multiple worker nodes.
- Deployments declare the desired state (image, replicas, update policy); controllers reconcile actual state to match desired state.
- Use
kubectlto inspect and manage the cluster. - Kubernetes talks to container runtimes via the CRI; Docker Engine requires an adapter for compatibility in modern clusters.