Series Kubernetes & Helm from scratch · Part 1
Kubernetes and Helm from scratch: concepts and architecture
The mental model you need before touching kubectl: what a cluster is made of, the objects you'll use daily, where Helm fits, and what we'll build.
This series is my notes from learning Kubernetes and Helm properly, by building something real rather than deploying yet another hello-world. Over 14 parts we’ll take a full-stack authentication app (a Next.js frontend, a Spring Boot API, PostgreSQL and Redis) and run it on a local Minikube cluster the way a production team would: separate namespaces, Helm charts, Ingress, metrics and logs. Nothing in it is tied to one cloud, so the same charts will run on EKS, AKS, GKE or anywhere else.
Before we install anything, it’s worth getting the mental model right. Most Kubernetes confusion comes from not knowing which part of the system is responsible for what.
What problem Kubernetes solves
Running one container is easy. Running dozens of them across several machines is not: something has to decide which machine each container runs on, restart it when it crashes, replace it when the machine dies, roll out new versions without downtime, and let containers find each other when their IP addresses keep changing.
Kubernetes does all of that, and it does it declaratively. You don’t tell it “start three containers”. You tell it “I want three copies of this running”, and it works continuously to make reality match that description. If a container dies, the cluster notices the difference and fixes it. That reconciliation loop is the single most important idea in Kubernetes.
The anatomy of a cluster
A cluster has two halves: the control plane, which makes decisions, and the worker nodes, which run your containers.
The control plane is the brain:
- The API server is the only way in.
kubectl, Helm, your CI pipeline and the other components all talk to it. - etcd is a key-value store holding the cluster’s state: everything you’ve asked for, and what currently exists.
- The scheduler decides which node each new pod should run on, based on the resources it requests.
- The controller manager runs the reconciliation loops. When the desired state and the actual state differ, a controller acts.
Each worker node runs three things: the kubelet, an agent that starts and watches the pods assigned to its node; kube-proxy, which programs the networking so Services work; and a container runtime such as containerd, which actually runs the containers.
On Minikube, all of this lives on one node on your laptop, but the model is identical to a 100-node production cluster.
The objects you’ll use every day
You describe what you want with objects, usually written as YAML. These are the ones this series uses constantly:
How the pieces connect: labels and selectors
Objects don’t reference each other by name as much as you’d expect. Instead, they use labels (key-value tags on an object) and selectors (queries over those labels). A Deployment stamps a label such as app=auth-service on every pod it creates, and a Service sends traffic to whatever pods currently match that label.
This loose coupling is why you can scale, roll out a new version or lose a node without reconfiguring anything. It’s also why the selector labels must stay stable over the life of an app, which comes back to bite people in Helm charts (part 3 explains how to avoid it).
Where Helm fits
Once you have a Deployment, a Service, an Ingress, a ConfigMap and a Secret for each app, in dev, staging and production, you end up copying near-identical YAML files and editing them by hand. Helm fixes that. A Helm chart is a package of templated YAML with default values; you install it as a release and override only what differs per environment:
helm install auth ./charts/auth-service -f values-prod.yaml
helm upgrade auth ./charts/auth-service --set image.tag=1.4.2
helm rollback auth 1
Helm also gives us ready-made, well-maintained charts for PostgreSQL, Redis and the whole Prometheus stack, so we don’t hand-write those.
What we’re going to build
The finished system runs in one cluster, split into three namespaces. This is the industry-standard approach: one cluster, with namespaces for logical separation, access control and resource quotas, rather than a separate cluster per component.
A few design choices are worth calling out now:
- The frontend and backend live in
apps; the databases live indata. Stateful services have very different lifecycles, backup needs and access rules from stateless apps, so they’re kept apart. - Apps find each other by DNS, not IP addresses. The backend connects to something like
postgresql.data.svc.cluster.local, which keeps working however often pods are replaced. - Only the Ingress is exposed. Everything else uses internal
ClusterIPServices. - Nothing is cloud-specific. No load balancer annotations, no managed-database assumptions: the same charts deploy anywhere.
The roadmap
- Foundation (parts 1–3) Concepts, Minikube and your first deployment, then Helm fundamentals and your first chart.
- Application development (parts 4–6) The Spring Boot auth API, the Next.js frontend, and containerising both.
- Stateful services (parts 7–8) PostgreSQL and Redis with Bitnami's Helm charts.
- Application deployment (parts 9–11) Our own Helm charts for both apps, then Ingress, service discovery and an umbrella chart.
- Observability (parts 12–13) Metrics with Prometheus and Grafana, and logs with Loki.
- Production readiness (part 14) Secrets, resource limits, health checks and autoscaling.
Takeaways
- Kubernetes is declarative: you describe the desired state and controllers keep reality in line with it.
- The control plane decides; the kubelet on each node does. Everything goes through the API server.
- Deployments own pods, Services find them by label, and Ingress routes outside traffic to Services.
- Helm turns repetitive YAML into versioned, configurable packages you install, upgrade and roll back.
- One cluster, separate namespaces, DNS-based discovery and no cloud-specific settings keeps the setup portable.
Next, in part 2, we start Minikube, create the namespaces and deploy our first workload.