Kubernetes for developers: a complete beginner's guide
By Flavio
Updated
Tagged: Kubernetes
Learn what Kubernetes is and how Pods, Deployments, Services, YAML manifests, scaling, updates, and self-healing work in a local cluster.
Kubernetes runs and coordinates containerized applications across a group of machines. You hand it a container image, describe how you want the app to run, and it takes care of starting it, keeping it alive, replacing crashed instances, scaling it up or down, and helping other apps find it over the network.
From the outside, Kubernetes looks intimidating because of all the jargon you hit on day one: clusters, nodes, Pods, Deployments, Services, labels, selectors, manifests, namespaces, volumes, ConfigMaps, and plenty more. You don’t need all of that right away. We’ll focus on the small set of ideas a developer uses every day, then spin up an app in a local cluster so you can see them working.
What problem does Kubernetes solve?
Say you’ve packaged a web app in a Docker image. You can start it locally with a single command:
docker run -p 8080:80 my-web-app
For local development and plenty of small sites, that’s all you need.
Now picture that app getting real traffic. You want five copies running across a few servers, with traffic always routed to a healthy instance. If a process crashes, a fresh one should come up automatically, and shipping a new version shouldn’t drop active users.
Once you’re in that territory, a bunch of tricky questions show up right away:
- Which server has room for the next container?
- How do containers find each other on the network?
- What happens if an entire server dies?
- How do you roll out a new image safely?
- How do you go from five copies to ten when traffic spikes?
- How do you pass in config values and secrets?
You could glue together scripts to handle all of this, and before long you’d have built a container orchestrator of your own. Kubernetes saves you from writing that plumbing yourself.
What does container orchestration mean?
An orchestrator coordinates a bunch of moving parts so they act like one system. Kubernetes doesn’t build your app for you. It expects a container image that’s already ready to run, then decides which machine gets which container, keeps an eye on them, wires up their networking, and steps in whenever the live cluster drifts away from your config.
You give it a rule like this:
Run three copies of this image and make them reachable through one stable name.
From that point on, Kubernetes does the ongoing work to keep that true.
Do you need Kubernetes?
Most apps don’t need Kubernetes on day one. A single server, a managed platform, or a simpler container host is usually cheaper and much easier to run.
Kubernetes starts paying off when you’re juggling enough services, machines, traffic, or teams that everyone benefits from running things the same way. For a team at that stage, it gives you:
- one consistent way to run containers
- automatic restarts and replacements when something crashes
- scaling out by adding more copies
- controlled rollouts when you ship new versions
- built-in service discovery so apps can find each other
- the same API across different infrastructure providers
The catch is that running a cluster is real work. Someone still has to look after upgrades, access rules, networking, storage, observability, and costs. Managed Kubernetes takes some of that off your plate, though plenty of it stays with you.
My advice is to learn Kubernetes because the ideas carry over everywhere, then adopt it only when a project needs it.
Kubernetes and Docker are different things
People often compare Docker and Kubernetes as if you have to pick one, when they do different jobs. Docker helps you build and run containers, while Kubernetes coordinates those containers across a cluster of machines.
A typical workflow looks like this:
- You write an application.
- A Dockerfile describes how to package its container image.
- CI builds that image and pushes it to a registry.
- Kubernetes pulls the image and runs it.
Kubernetes doesn’t even require Docker Engine under the hood and can use other container runtimes instead. What matters is the standard container image format, regardless of whether Docker Desktop is installed anywhere near the cluster.
If containers are still new to you, read my introduction to Docker before going further.
The first Kubernetes mental model
Kubernetes is built around desired state. Instead of telling the cluster every step to take, you declare what the end result should look like, and Kubernetes keeps comparing that declaration against what’s running right now.
Say you ask for three copies of a web app, so Kubernetes starts three. If one crashes and disappears, the cluster sees two running instead of three and immediately starts a replacement.
That continuous check-and-fix loop is called reconciliation, and the piece doing it is a controller. Each controller watches one kind of desired state and nudges the cluster toward it. You don’t need to dig into how controllers work under the hood yet, just hold onto this rule:
Kubernetes is always trying to make the current state match the desired state.
What is a Kubernetes cluster?
A cluster is the whole Kubernetes environment, split into two main parts:
- the control plane, which manages the cluster
- one or more worker nodes, which run your applications
While you’re learning, both halves can live together on your computer. In production, they’re usually spread across multiple machines. The official component overview goes deep into every piece, though a rough picture is plenty to get started.
What does the control plane do?
The control plane is the brain of the cluster. It takes your requests, decides which machine should run each workload, runs the controllers that keep everything in line, and stores the cluster’s state in a database.
Its four main pieces are:
- API server: the front door to Kubernetes
- scheduler: picks a node for each new Pod
- controller manager: runs the reconciliation loops
- etcd: stores the cluster’s data
When you run a kubectl command, you’re talking to the API server rather than connecting to a worker node and starting containers by hand.
What is a worker node?
A node is a physical server or virtual machine where your containers run. Each node has three main pieces installed on it:
- a kubelet that talks to the control plane
- a container runtime that runs containers
- networking components that route traffic
Once the scheduler assigns a Pod to a node, the kubelet on that machine takes over and makes sure its containers stay up. As an app developer, you’ll spend most of your time working with Kubernetes objects instead of individual nodes.
What is a Kubernetes object?
A Kubernetes object is a record stored through the Kubernetes API representing something you want the cluster to manage. Common ones include:
- Pod
- Deployment
- Service
- ConfigMap
- Secret
- Namespace
You normally define objects in YAML files called manifests. Here’s what a small Pod manifest looks like:
apiVersion: v1
kind: Pod
metadata:
name: web
spec:
containers:
- name: nginx
image: nginx:stable-alpine
Almost every manifest shares four top-level fields:
apiVersionpicks the Kubernetes API versionkindnames the type of objectmetadataidentifies the objectspecdescribes the desired state, with fields that depend on the object type
Alongside spec, Kubernetes keeps a status section up to date to record what’s running right now compared to what you asked for.
What is a Pod?
A Pod is the smallest unit you can deploy in Kubernetes. It wraps one or more containers that always run together, share networking, and can share storage.
Most of the time, a Pod holds a single main container. You can put two containers in the same Pod if they always need to run together and talk over localhost, though you won’t need that pattern much when you’re starting out.
Don’t think of a Pod as a tiny permanent server. Pods are disposable, so Kubernetes will happily delete one and spin up a fresh replacement with a new name and IP address while keeping your app online. Because of that, you rarely create standalone Pods in production. You create a Deployment and let it manage the Pods for you.
What is a Deployment?
A Deployment manages a group of Pods for an app. You give it a container image and how many copies you want, and it takes care of creating and updating them. Here’s an example manifest that asks for three Pods:
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 3
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: nginx
image: nginx:stable-alpine
Inside that manifest, template is the recipe Kubernetes uses to create each Pod. When you update the template, the Deployment can roll out new Pods gradually while retiring the old ones. For any stateless web app, a Deployment is usually the first workload object you’ll reach for.
What is a Service?
Because Pods come and go with new names and IP addresses, you run into a networking problem: how does a frontend find its backend if the backend Pods keep getting replaced?
A Kubernetes Service solves this by putting a stable network endpoint in front of a group of Pods, matching them through labels. Here’s a minimal Service manifest:
apiVersion: v1
kind: Service
metadata:
name: web
spec:
selector:
app: web
ports:
- port: 80
targetPort: 80
That selector matches any Pod with the app: web label and routes incoming traffic to one of them, even as individual Pods get deleted and recreated behind it. Each object handles a different job:
- a Deployment keeps the right Pods running
- a Service gives those Pods a stable network address
Labels and selectors
Labels are key-value pairs you attach to Kubernetes objects, like this:
metadata:
labels:
app: web
environment: development
A selector finds objects carrying matching labels. Deployments use selectors to keep track of their Pods, and Services use them to figure out which Pods should receive traffic, so nothing ever has to hard-code a Pod name.
The flip side is one of the most common beginner bugs in Kubernetes: if a Service selector doesn’t match your Pod labels, the Service has nowhere to send traffic. Whenever a Service stops working, check its selector against the labels on the Pods first.
Install the local tools
To try this locally, we’ll use two tools:
kubectl, the Kubernetes command-line clientminikube, which spins up a local Kubernetes cluster
Follow the official guides to install kubectl and install minikube. You’ll also need a supported container or VM driver. Docker Desktop is usually the easiest option on macOS and Windows.
Once both are installed, make sure both commands work:
kubectl version --client
minikube version
Next, start your local cluster (this can take a few minutes the first time):
minikube start
Check that everything came up cleanly:
minikube status
You should see the host, kubelet, and API server all listed as running.
What is kubectl?
kubectl is the CLI that sends requests to the Kubernetes API. People pronounce it “kube control” or “kube C T L”, and everyone knows what you mean either way.
Check which cluster you’re connected to:
kubectl cluster-info
Then list the nodes in that cluster:
kubectl get nodes
Your minikube cluster normally has just one node. It’s smaller than a production cluster, of course, but it speaks the exact same core Kubernetes API.
Create your first Deployment
The quickest way to create a Deployment is straight from the command line. Run the example from the Hello Minikube tutorial:
kubectl create deployment hello-node \
--image=registry.k8s.io/e2e-test-images/agnhost:2.53 \
-- /agnhost netexec --http-port=8080
That creates a Deployment named hello-node and tells Kubernetes to run a container from that image. List your Deployments to confirm it’s there:
kubectl get deployments
You should see output along these lines:
NAME READY UP-TO-DATE AVAILABLE AGE
hello-node 1/1 1 1 30s
Now list the Pods in the cluster:
kubectl get pods
You’ll see a single Pod with a random suffix attached to its name:
NAME READY STATUS RESTARTS AGE
hello-node-6c9b8b8d7c-k2m5p 1/1 Running 0 30s
Your exact Pod name will be different, since Kubernetes generates that suffix on the fly. The Deployment owns that Pod: you asked for a Deployment, and its controller created the Pod to match your desired state.
Inspect the Deployment
To see what’s going on under the hood, inspect the Deployment with describe:
kubectl describe deployment hello-node
describe prints configuration details along with recent events, making it one of the most useful commands when something refuses to start. You can run the same command on the Pod itself (swap <pod-name> for the name from kubectl get pods):
kubectl describe pod <pod-name>
Scroll to the Events section near the bottom. That’s where Kubernetes logs image pulls, scheduling decisions, restarts, and failures.
Read application logs
When a container starts up fine but the app inside it misbehaves, logs are usually the first thing you want to check. Start by grabbing the Pod name:
kubectl get pods
Once you have that name, you can print its logs:
kubectl logs <pod-name>
If your Deployment only runs one container per Pod, you don’t even have to look up the Pod name first. You can point kubectl straight at the Deployment instead:
kubectl logs deployment/hello-node
And if a Pod happens to run more than one container, pass -c along with the container name so kubectl knows which stream you want.
Expose the application
Right now your Pod only has an internal IP address inside the cluster, so you can’t reach it from your browser yet. To expose it, create a Service:
kubectl expose deployment hello-node \
--type=LoadBalancer \
--port=8080
You can confirm it’s there by listing your Services:
kubectl get services
On a cloud provider, a LoadBalancer Service asks the platform to spin up an external load balancer for you. Since you’re running locally on minikube, you can open the Service in your browser with this command:
minikube service hello-node
That opens the running app. Behind the scenes, the Service gives you a stable endpoint and forwards incoming traffic to a matching Pod.
Scale the application
Scaling a Deployment takes a single command. Let’s bump it from one Pod up to three:
kubectl scale deployment hello-node --replicas=3
Watch the Pods come up in real time:
kubectl get pods --watch
You’ll see Kubernetes start two more Pods right away, and you can press Ctrl+C once you’re done watching. Nothing changes on the Service side: it keeps the same stable identity and sends incoming requests to any of the three matching Pods.
Scaling back down works the same way, just with a lower target:
kubectl scale deployment hello-node --replicas=1
Kubernetes sees the new count and removes the extra Pods for you.
See self-healing in action
You can see Kubernetes recover from a failure in about ten seconds. First, make sure the Deployment is set to one replica:
kubectl get deployment hello-node
List the Pod to get its name:
kubectl get pods
Now delete that Pod manually:
kubectl delete pod <pod-name>
List your Pods again right after:
kubectl get pods
The Pod you deleted is gone, and a new one is already taking its place. Notice you never asked Kubernetes to start a replacement. Because the desired state still asked for one replica while the cluster briefly had zero, the Deployment controller spotted the mismatch and created a new Pod to close the gap.
That reconciliation loop is at the heart of how Kubernetes manages workloads.
Imperative commands versus YAML manifests
Everything we’ve run so far, commands like kubectl create and kubectl scale, uses the imperative style, where you tell Kubernetes to perform a specific action right now. That’s handy when you’re learning, debugging a broken cluster, or testing a quick idea.
For applications you plan to maintain, you’ll usually switch to the declarative style instead. You write YAML manifests that describe the desired state, commit them to Git, and apply them with kubectl apply. That gives you change history, code review, and a setup you can reproduce reliably. Let’s build the same kind of app using a file.
Create a declarative application manifest
Start with a clean slate by deleting the objects from the previous command-line example:
kubectl delete service hello-node
kubectl delete deployment hello-node
Next, create a file named app.yaml with this configuration:
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: nginx
image: nginx:stable-alpine
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: hello-web
spec:
selector:
app: hello-web
ports:
- port: 80
targetPort: 80
That --- separator lets you put two Kubernetes objects in the same YAML file. The first block defines a Deployment that runs two Nginx Pods, and the second defines a Service whose selector targets the app: hello-web label on those Pods.
Send the file to the cluster with kubectl apply:
kubectl apply -f app.yaml
Kubernetes will confirm that both the Deployment and the Service were created. You can check them together with:
kubectl get deployments,pods,services
Access the declarative application
Because we didn’t specify a Service type, Kubernetes defaults to ClusterIP. That makes the Service reachable inside the cluster, not directly from your computer. For local development, you can bridge that gap with port forwarding:
kubectl port-forward service/hello-web 8080:80
Leave that command running and open http://localhost:8080 in your browser. Your browser connects to port 8080 on your machine, and kubectl forwards the connection straight to port 80 on the Service. Press Ctrl+C when you’re done. Port forwarding is convenient for local testing and inspection, though in production you’ll expose apps through a load balancer, Ingress, or Gateway instead.
Change the desired state
To change a running app in the declarative workflow, you edit the manifest and apply it again. Open app.yaml and update the replica count from:
replicas: 2
to four replicas:
replicas: 4
Then apply the updated file:
kubectl apply -f app.yaml
Check your Pods right after:
kubectl get pods
Kubernetes creates two extra Pods to match the new number. The same manifest both created the app and scaled it, and anyone reading Git can see the exact commit where the desired replica count moved from two to four.
Update the container image
Updating the container image works the same way. Swap the image in app.yaml:
image: nginx:1.30-alpine
Apply the change to the cluster:
kubectl apply -f app.yaml
You can watch the rollout progress in your terminal:
kubectl rollout status deployment/hello-web
Instead of tearing everything down at once, the Deployment runs a rolling update: it brings up new Pods with the updated template while gradually retiring the old ones. If you list the Pods mid-update, you’ll see the transition happening:
kubectl get pods --watch
Deployments also keep rollout history and support rollbacks if something breaks, though you don’t need to master those commands yet. The main thing to remember is that any change to the Pod template creates a new Deployment revision.
Why image tags matter
Avoid deploying with mutable tags like latest for real releases, because the image behind that tag can change over time and make deployments hard to reproduce. Pin a specific version tag or an immutable image digest instead. Writing a pinned reference like this:
image: nginx:1.30-alpine
leaves much less room for surprises than a floating tag like this:
image: nginx:latest
When you build your own images in CI, tagging each build with a release version or the Git commit gives you that same repeatability.
How Kubernetes knows an application is healthy
Just because a process is running doesn’t mean the app is healthy. It might still be starting up and refusing traffic, or it could be stuck while the container stays alive. Kubernetes handles this with health checks called probes:
- a startup probe checks whether the app has finished starting
- a readiness probe checks whether the Pod should receive traffic
- a liveness probe checks whether the container should be restarted
Here’s a minimal readiness probe for Nginx, which goes inside the container definition:
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 2
periodSeconds: 5
If that check fails, the Service stops sending new traffic to that Pod. Don’t copy random probe timings straight into production; set the intervals and timeouts based on how fast your app starts and responds.
Requests and limits
To place containers sensibly, Kubernetes needs to know how much CPU and memory each one expects. A request helps the scheduler pick a node with enough room, while a limit caps how much of a resource the container can use.
Here’s an example block that also belongs inside the container definition:
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
memory: 128Mi
Here 100m means one tenth of a CPU core. Getting resource settings right matters a lot on shared clusters, where sloppy numbers waste capacity or leave apps unstable. For your first local experiments, though, it’s fine to leave them out.
What is a Namespace?
A Namespace groups Kubernetes objects inside a single cluster, and anything you create without specifying one lands in the default Namespace. You can list the existing Namespaces with:
kubectl get namespaces
When you want to separate an application or environment, create a dedicated Namespace:
kubectl create namespace demo
Then list the Pods running inside that Namespace:
kubectl get pods -n demo
Namespaces keep resource names organized and help you scope access policies, though they aren’t separate clusters. Cluster-wide resources and shared infrastructure still live outside any single Namespace. While you’re learning, staying in default keeps things simple.
What is a ConfigMap?
A ConfigMap stores non-secret configuration such as feature flags, log levels, or config files. You can expose those values to a container as environment variables or mount them as files.
Separating configuration from the container image lets you run the same image in development and production while supplying different settings. Just don’t put passwords or API keys in a ConfigMap.
What is a Secret?
A Kubernetes Secret stores sensitive configuration like passwords or tokens, though the name can give a false sense of security. In YAML manifests, Secret values are usually base64-encoded, not encrypted, so anyone who can read the Secret can decode them right away.
In production, you need tight access permissions and encryption at rest on the cluster, and many teams also connect Kubernetes to an external secret manager. Starting out, stick to two habits:
- never commit plaintext secrets to Git
- restrict who and what can read Kubernetes Secrets
What about databases and storage?
Containers and Pods are replaceable, while application data usually has to survive when a Pod disappears. Kubernetes does support persistent storage through PersistentVolumes and PersistentVolumeClaims, and it offers StatefulSets for workloads that need stable identities or ordered behavior.
Even with those building blocks, running a reliable production database involves backups, replication, upgrades, monitoring, and recovery procedures. Don’t move a database into Kubernetes just because you learned how to run a Deployment. A managed database outside the cluster is often a much better place to start.
How traffic reaches an application
Kubernetes networking has plenty of layers, so it helps to keep the first model simple. Inside the cluster, traffic follows three steps:
- A Pod runs the application.
- A Service gives matching Pods a stable endpoint.
- Other applications connect to the Service by name.
For traffic coming in from the internet, clusters usually rely on one of these options depending on your setup and cloud provider:
- a Service with type
LoadBalancer - an Ingress controller
- a Gateway API implementation
Start with Services, and pick up Ingress or Gateway once you need to expose several real applications.
The main Service types
When you read Service manifests, you’ll run into four main types:
ClusterIPis the default and is reachable only inside the clusterNodePortopens a port on every nodeLoadBalancerasks the environment for an external load balancerExternalNamemaps a Service name to an external DNS name
Most internal services use ClusterIP. Public exposure depends on where the cluster runs: a LoadBalancer Service on minikube behaves differently from one on AWS or Google Cloud, because Kubernetes defines the Service spec while the host environment provides the load balancer behind it.
A request through the cluster
Let’s follow one request hitting our example app. Your browser connects to the local forwarded port, and kubectl port-forward carries the connection into the cluster to the hello-web Service.
That Service looks for matching Pods using this selector:
selector:
app: hello-web
Kubernetes tracks the ready Pods carrying that label and routes the connection to one of them on targetPort: 80, where Nginx responds. If Kubernetes later replaces that Pod, the Service sends future connections to another matching Pod. Your browser never has to know a single Pod name or IP address.
How to debug a failing application
Kubernetes errors feel overwhelming when you inspect everything at once, so stick to a short routine. Start by listing the objects in your cluster to see what’s unhealthy:
kubectl get deployments,pods,services
Once you spot a failing Pod, inspect its details:
kubectl describe pod <pod-name>
If the container started at all, read its logs next:
kubectl logs <pod-name>
Then check recent cluster events, which often point straight to scheduling errors or image pull failures:
kubectl get events --sort-by=.metadata.creationTimestamp
The Pod status usually gives you a strong clue right away:
Pendingmay mean the scheduler can’t place the Pod on a nodeImagePullBackOffmeans Kubernetes can’t pull the container imageCrashLoopBackOffmeans the container keeps crashing and restartingRunningmeans the process is alive, even if the app isn’t ready for traffic yet
If the Pods look healthy but networking fails, inspect the Service:
kubectl describe service hello-web
Then double-check whether its selector matches the labels on your Pods:
kubectl get pods --show-labels
Running through that short sequence solves a large share of beginner issues.
Useful kubectl commands
You don’t need to memorize the whole kubectl CLI to get started. Keep these commands handy as a quick reference for your first experiments.
To list resources in your cluster:
kubectl get pods
kubectl get deployments
kubectl get services
To pull more detailed information about a resource:
kubectl get pods -o wide
kubectl describe pod <pod-name>
To read logs from a Pod:
kubectl logs <pod-name>
To follow logs live:
kubectl logs -f <pod-name>
To apply a manifest:
kubectl apply -f app.yaml
To delete objects defined in a manifest:
kubectl delete -f app.yaml
To wait for a rollout to finish:
kubectl rollout status deployment/hello-web
And to forward a local port:
kubectl port-forward service/hello-web 8080:80
Those commands are more than enough for your first round of experiments.
Clean up the example
When you’re finished, remove the objects declared in app.yaml:
kubectl delete -f app.yaml
Check that they’re gone:
kubectl get deployments,pods,services
The built-in kubernetes Service stays around, which is expected since it represents the Kubernetes API.
Next, stop the local cluster so it frees up resources while staying available for later:
minikube stop
If you want to remove the local cluster completely instead, run:
minikube delete
Kubernetes and Terraform
Terraform and Kubernetes both rely on declarative configuration, so people often wonder where one ends and the other begins. In practice, they usually manage different layers of the stack.
Terraform works well for provisioning the underlying infrastructure:
- virtual networks
- Kubernetes clusters
- node pools
- databases
- DNS records
Once the cluster is up, Kubernetes manages the workloads running inside it:
- Deployments
- Services
- ConfigMaps
- application Pods
Terraform can also manage Kubernetes objects through its Kubernetes provider, which can be useful in some setups. Still, you don’t need one tool to own everything. Many teams use Terraform for the cluster and surrounding infrastructure, then handle application releases with Kubernetes manifests or Helm so it’s always clear which tool owns which layer.
Kubernetes and serverless platforms
Serverless platforms hide most of the infrastructure work. You deploy a function or an app, and the platform takes care of scheduling, scaling, and keeping the machines running.
Kubernetes gives you more control and a portable API, though you also take on a lot more day-to-day responsibility. If a managed platform already fits your app, those built-in limits save you time instead of getting in your way. Don’t pick Kubernetes just because it feels like the more serious choice.
Common beginner mistakes
Creating standalone Pods
If you create a standalone Pod directly and it crashes or its node goes down, nothing brings it back. For normal stateless apps, run your Pods through a Deployment so Kubernetes replaces them for you.
Treating Pods like servers
Don’t count on a Pod’s name, IP address, or local filesystem sticking around. Pods are meant to be thrown away and replaced whenever you deploy, scale, or recover from a crash, so treat them as temporary from the start.
Using latest for every image
The latest tag moves every time you push a new build, so it’s hard to know which version of your code is running in the cluster. Pin your releases to versioned tags or image digests instead.
Forgetting labels and selectors
A typo in a Service selector stops traffic from reaching your Pods, and it’s easy to miss. Whenever a Service isn’t finding your Pods, run kubectl get pods --show-labels and compare the Pod labels with the selector.
Editing live objects without updating Git
Patching a live object in the cluster can get you out of an emergency, and sometimes you have to do it. Just remember that your team’s manifests in Git are still the source of truth, so if you don’t bring that change back into the YAML file, the next deploy can undo your fix.
Giving every container unlimited resources
When you leave resource requests unset, the scheduler can’t make good placement decisions across your nodes. Before you move shared workloads into production, learn how resource requests work and set realistic values on your containers.
Putting secrets directly in YAML
Base64 encoding isn’t encryption, so anyone who can read the YAML can decode the values right away. Keep production secrets out of Git and out of plain manifests.
Running a database before understanding storage
A stateless app can restart without anyone noticing, while a misconfigured database can lose or corrupt data. Use a managed database if you can, or take the time to learn Kubernetes storage and operational basics before running a database inside your cluster.
Learning every Kubernetes object before deploying anything
You don’t need to memorize the whole Kubernetes API before you ship your first container. Start with Deployments, Pods, Services, labels, and kubectl, and pick up the rest once you run into a real need for them.
What we deliberately skipped
We left a lot of important production topics out of this guide on purpose:
- role-based access control
- network policies
- autoscaling
- Ingress and Gateway API
- persistent storage
- StatefulSets
- admission controllers
- custom resources and operators
- service meshes
- multi-cluster systems
You don’t need any of these to grasp how Kubernetes works. If you try to learn the whole list up front, it only buries the simple control loop at the center of the system.
A useful Kubernetes mental model
Once a few core pieces click, you can read most Kubernetes configs you come across without getting lost. Everything lives inside a cluster, which is a group of nodes (the machines doing the work) running Pods that each wrap one or more closely related containers.
On top of those Pods, a Deployment makes sure the right number of copies stay alive and rolls out updates, while a Service gives them a stable network address. Labels and selectors are the glue that connects Services and Deployments to the right Pods. When you run kubectl, you’re talking to the Kubernetes API to say what you want, and controllers keep nudging the cluster until reality matches your request.
Where to go next
The best next step is to repeat the local exercise using one of your own container images. Put it behind a Deployment and a Service, scale it up and down, delete a Pod to watch it come back, swap in a new image tag, and read the logs.
Once that feels familiar, add a readiness probe and resource requests to the manifest. You don’t need a complex production cluster to practice any of this, and seeing controllers keep your desired state alive on your own machine makes the rest of Kubernetes much easier to pick up later.
Want me to talk about your product? You can sponsor this site.