Kubernetes basics

What Is Kubernetes? Architecture, Objects and Uses

Kubernetes is an open source system for running containerized applications across a group of machines. You describe the state you want, such as three copies of a web service, and the cluster works to make reality match that description. It places containers on machines, restarts them when they fail, replaces them during an update, routes traffic to them and scales them up or down.

By , Founder at SeaGit

·

Key takeaways

  • Kubernetes runs containers across many machines and keeps them matching a declared desired state.
  • A cluster is a control plane plus nodes. The control plane stores state and makes decisions; the nodes run your containers.
  • The objects you meet first are Pod, Deployment, Service, ConfigMap, Secret and Namespace. Each one is a YAML or JSON resource that the API server stores.
  • Kubernetes is not a PaaS. It does not build your code, run your CI, or store your images. Those come from other tools.

What Kubernetes is

Kubernetes, often written k8s, is an open source platform for managing containerized workloads and services. The project describes it as supporting both declarative configuration and automation. You write manifests that say what should exist, you submit them to the cluster, and controllers keep the running system in line with them.

The word cluster means the group of machines plus the software that manages them. From the outside, a cluster looks like one pool of CPU and memory that you deploy into. You do not pick the machine for each container by hand; the scheduler does that.

The problem it solves

One container on one server is simple. Production is different. There are many services, many copies of each, machines that fail, traffic that rises in the morning and falls at night, and releases that must not take the site down. Doing this with scripts and SSH sessions works until a node dies at 3 a.m. or two teams deploy to the same host on the same afternoon.

Kubernetes moves those decisions into a control loop. You state how many copies you want and what each one needs. The cluster places them on nodes with room, watches them, and acts when reality drifts from the plan. The core jobs it takes on are these:

  • Scheduling: pick a node with enough free CPU and memory for each container.
  • Self-healing: restart containers that crash or fail a liveness probe.
  • Rollouts: replace pods gradually, and stop when new pods never become ready.
  • Service discovery and load balancing: give a stable name and address to a set of pods that keeps changing.
  • Scaling: change the replica count by hand, or let a HorizontalPodAutoscaler do it from metrics.

Where it came from

Kubernetes grew out of Borg, the internal cluster manager Google used for years to run its own production workloads. The Kubernetes project describes Borg as the predecessor and writes about the lessons the new system took from it. Google open sourced Kubernetes in 2014, and in 2015 it was donated to the newly formed Cloud Native Computing Foundation, which hosts the project today. The code is released under the Apache License 2.0, so the software itself costs nothing to use.

Architecture: control plane and nodes

A cluster has two kinds of machine. The control plane makes global decisions and stores the cluster state. Nodes, which are virtual or physical servers, run the containers. In a managed service the cloud provider runs the control plane and you run the nodes.

Control plane components

  • kube-apiserver: the front door. kubectl, controllers and kubelets all talk to its REST API, and it is the component that reads and writes cluster state.
  • etcd: a consistent, highly available key-value store that holds everything the cluster knows about itself.
  • kube-scheduler: chooses the node for each new pod, using resource requests, constraints and affinity rules.
  • kube-controller-manager: runs the controllers, loops that compare observed state with desired state and close the gap. Examples include the ReplicaSet and Job controllers.
  • cloud-controller-manager: connects the cluster to a cloud provider API for things like load balancers and node lifecycle. It is present only when you run on a cloud.

Node components

  • kubelet: the agent on each node. It makes sure the containers described in the pod specs are running and reports their status back.
  • kube-proxy: maintains network rules on the node so that Service addresses reach the right pods.
  • Container runtime: the software that actually starts containers, through the Container Runtime Interface. containerd and CRI-O are two examples.

Kubernetes removed built-in support for Docker Engine as a runtime in version 1.24. Images built with Docker still run, because they follow the OCI image format and any compliant runtime can start them.

Core objects you will meet first

Everything in Kubernetes is an API object stored in the cluster. Each one has an apiVersion, a kind, metadata and usually a spec. These are the objects that come up in almost every project:

ObjectWhat it does
PodThe smallest unit you deploy. One or more containers that share a network address and storage. Most pods hold one main container.
ReplicaSetKeeps a fixed number of identical pods running. You rarely create one directly.
DeploymentManages a ReplicaSet for a stateless app and handles rolling updates and rollback.
StatefulSetPods with stable names and their own storage, for databases and other stateful workloads.
DaemonSetRuns one pod on every node, or on every node that matches a selector. Typical use: log and monitoring agents.
JobRuns pods until a task completes. A CronJob runs Jobs on a schedule.
ServiceA stable name and virtual IP that routes traffic to the pods selected by label.
Ingress, Gateway APIHTTP routing from outside the cluster to Services. The Ingress API is frozen, and the Gateway API is the successor for new work.
ConfigMapNon-secret configuration as key-value data, injected as environment variables or files.
SecretSensitive values such as passwords and tokens. Values are base64 encoded, not encrypted by default. See Kubernetes Secrets explained.
NamespaceA named scope for grouping resources, applying quotas and limiting access. See Kubernetes namespaces explained.

Desired state and reconciliation

Kubernetes is declarative. You write what should exist, not the steps to reach it. You submit a manifest with kubectl apply, the API server stores it as the desired state, and controllers keep comparing that state with what is actually running. When they differ, they act: they create a missing pod, delete an extra one, or roll out a new pod template. This is called reconciliation.

Reconciliation explains two behaviours that surprise newcomers. Delete a pod and a new one appears, because the ReplicaSet still wants the count to be met. Edit a running pod by hand and the change can be reverted, because the next reconcile compares it with the manifest. The practical rule is to change the manifest and apply it, rather than patch live objects that the next apply will overwrite.

A minimal Deployment and Service

The example below runs two copies of a web container and gives them one stable address inside the cluster. The Deployment keeps the replicas alive. The Service finds them by label and load balances between them.

yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-web
spec:
  replicas: 2
  selector:
    matchLabels:
      app: hello-web
  template:
    metadata:
      labels:
        app: hello-web
    spec:
      containers:
        - name: web
          image: nginx:1.27
          ports:
            - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: hello-web
spec:
  selector:
    app: hello-web
  ports:
    - port: 80
      targetPort: 80
The Deployment selector must match the pod template labels. The Service selector must match the same labels.

Save the manifest as hello-web.yaml, apply it with kubectl apply -f hello-web.yaml, and check the result with kubectl get deploy,pods,svc. If you want a starting point for your own app, the Kubernetes deployment YAML generator builds a Deployment and Service from a few inputs.

  • The default Service type is ClusterIP, which is reachable only from inside the cluster. Traffic from outside needs a LoadBalancer Service, an Ingress or a Gateway.
  • Add a readiness probe so the Service sends traffic only to pods that are ready. The difference between the probes is covered in Liveness vs readiness probe.
  • When a pod misbehaves, kubectl logs shows what its container printed. See kubectl logs for the flags that matter.

What Kubernetes does not do

Kubernetes is not a platform as a service. The project says so in its own overview: it does not deploy source code and does not build your application. There is no built-in CI pipeline, no source-to-image build, and no image registry. Those are separate tools. A CI system builds the image, a registry stores it, Git holds the code, and Kubernetes runs the result.

  • Build: Kubernetes runs container images. It does not create them. Your pipeline needs a build step.
  • Ship: a manifest is applied with kubectl or a GitOps tool. The cluster does not decide when to release.
  • Observe: there is no default log store or metrics database. You install and pay for the backend that keeps logs and metrics.
  • Secure by default: pods can reach each other unless you add NetworkPolicy, and access control depends on RBAC rules you write.
  • Run databases for you: a stateful service needs storage, backups and a failover plan. StatefulSets give the building blocks, not the operations.

When you need Kubernetes, and when you do not

Kubernetes pays off when you run many services, need to spread them across several machines, want self-healing and rolling releases, or need the same workload definitions in several environments. It is heavy for one small app on one server, and the operating cost is real. Ask who will run the cluster, how many people must understand it, and whether your workloads will use its controllers.

SituationUsually a better fit
One app, low traffic, a server or twoA platform as a service or a single VM with a process manager
A few containers on one host, local developmentDocker Compose. See Docker Compose vs Kubernetes.
Many services, several teams, autoscaling across machinesKubernetes
Containers on AWS, without running a cluster control planeAmazon ECS. See EKS vs ECS.

Scaling is one area where the platform does real work. A HorizontalPodAutoscaler changes the replica count of a Deployment from observed metrics, so you do not need a person watching a dashboard during a traffic spike.

Managed Kubernetes on AWS and elsewhere

Running the control plane yourself means managing etcd backups, certificates and upgrades. Most teams that adopt Kubernetes start with a managed service instead. Amazon Elastic Kubernetes Service (EKS) runs the control plane across multiple AWS Availability Zones. You add worker capacity with managed node groups, self-managed nodes or AWS Fargate for pods. Google Kubernetes Engine and Azure Kubernetes Service are managed offerings on other clouds. The Kubernetes production environment guide covers the setup options for hosted and managed clusters.

SeaGit deploys apps to Amazon EKS in your own AWS account. The cluster, its nodes and the workloads run in your account, and the platform manages the deployment on top of them. SeaGit is AWS only.

Frequently asked questions

What Is Kubernetes? Architecture, Objects and Uses: FAQ

Is Kubernetes a container?

No. Kubernetes is an orchestrator for containers. It decides where containers run and keeps them running, but a container runtime such as containerd is what starts them on each node.

What is the difference between Docker and Kubernetes?

Docker is a set of tools for building and running containers, mainly on one host. Kubernetes runs containers across many hosts and handles scheduling, scaling and rollouts. They work together: you often build an image with Docker and Kubernetes runs it.

What does k8s mean?

k8s is a short form of Kubernetes. The 8 stands for the eight letters between the k and the s. The name comes from the Greek word for helmsman or pilot.

Is Kubernetes free?

The software is open source under the Apache License 2.0, so there is no license fee. You still pay for the machines it runs on, for a managed control plane if you use one, and for the people who operate it.

Is Kubernetes hard to learn?

The concepts are many: pods, controllers, networking, storage and access control. Basic deploys are learnable in a few days. Running a production cluster well takes ongoing practice. Start with a managed cluster and one app, and learn Deployments, Services and kubectl first.

What is a cluster?

A cluster is the control plane plus the nodes it manages, presented as one pool of compute. Inside a cluster you divide resources with namespaces, and you deploy workloads to the cluster as a whole.

Sources

Checked 12 October 2026.

  1. Kubernetes: Overview — The definition of Kubernetes, the declarative model, and the statement that it does not build or deploy source code.
  2. Kubernetes: Cluster Architecture components — Control plane components, node components and the container runtime.
  3. Kubernetes: Working with Kubernetes objects — The apiVersion, kind, metadata and spec structure of API objects.
  4. Kubernetes: Controllers — The control loop that compares observed state with desired state.
  5. Kubernetes: Ingress — Ingress routing and the note that the Ingress API is frozen in favour of Gateway API.
  6. Kubernetes: Secrets — Base64 encoding of Secret values and their default storage in etcd.
  7. Kubernetes: Migrating from dockershim — Removal of built-in Docker Engine support in version 1.24.
  8. Kubernetes: Production environment — Production cluster setup options, including hosted and managed services.
  9. Kubernetes blog: Borg, the predecessor to Kubernetes — Borg as the internal system that Kubernetes grew out of.

Read next