Kubernetes Pod vs Deployment: What's the Difference

Run kubectl run nginx --image=nginx:1.27 and Kubernetes creates exactly one Pod named nginx. Delete it with kubectl delete pod nginx and it is gone for good — nothing notices, nothing replaces it. A Pod is the smallest deployable unit in Kubernetes: one or more containers that share a network namespace and a set of volumes, scheduled together onto a single node. That single Pod is a dead end in production. If the container inside it crashes, the kubelet restarts the container in place. If the node reboots, or someone deletes the Pod, nothing recreates it. A bare Pod has no memory of the fact that it is supposed to exist. ...

September 10, 2026 Â· 5 min Â· 991 words Â· SpaghettiCoder

Environment Variables and Secrets in Docker

Where a container’s environment variables end up Start a container with -e DB_PASSWORD=hunter2 and run docker inspect on it: 1 2 docker run -d --name api -e DB_PASSWORD=hunter2 nginx:alpine docker inspect --format '{{json .Config.Env}}' api 1 ["DB_PASSWORD=hunter2","PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"] The password sits there in plain text, readable by anyone with access to the Docker socket, by docker exec api env, and by any process running inside the container. That is not a bug — it is what environment variables are for. The problem is using them for values that should never be that visible. ...

September 9, 2026 Â· 6 min Â· 1221 words Â· SpaghettiCoder

How to Reduce Docker Image Size

Why a Docker image ends up ten times bigger than the app A Node service with a few hundred kilobytes of source code ships as an image over 1 GB. That is the normal outcome of a working build, not a mistake anyone made on a particular line. The weight comes from a base image carrying a full OS, a build toolchain the running app never calls, and a package manager cache nobody told the build to delete. ...

September 8, 2026 Â· 6 min Â· 1215 words Â· SpaghettiCoder

Dockerfile Best Practices: Smaller, Faster Builds

What a bad Dockerfile costs you 1 2 3 4 5 6 FROM node:latest COPY . . RUN npm install CMD ["node", "server.js"] Four lines, and every one of them costs you something. docker build re-runs npm install on every code change, because COPY . . breaks the layer cache before the install step ever gets a chance to be reused. The final image carries the full Debian base, the entire node_modules tree including dev dependencies, and whatever build tools npm install pulled in to compile native modules. Nothing is discarded. The container runs as root, because nothing tells it not to, and node:latest means the base image can change under you between one build and the next, with no record of what you actually shipped. ...

September 7, 2026 Â· 9 min Â· 1860 words Â· SpaghettiCoder

What Is a Docker Network and How to Use It

Why two containers on the same host can’t reach each other by default Start Postgres and your API with plain docker run and the API cannot reach the database, even though both containers sit on the same machine. 1 2 docker run -d --name db postgres:16 docker run -d --name api myapp Both land on Docker’s default bridge network, where every Docker container goes unless you say otherwise. They get IP addresses. What they don’t get is any way to find each other by name, so the API would have to hardcode the database’s internal IP — an address that changes every time the container restarts. ...

September 6, 2026 Â· 6 min Â· 1210 words Â· SpaghettiCoder

What Is Docker Compose and How to Use It

The problem Compose solves A real application is rarely one container. A web API needs a database, the database needs a volume so its data survives a restart, and then you add a Redis cache and a background worker. That is four docker run commands, each with its own flags for ports, volumes, environment variables and a shared network. In the right order. Every time you sit down to work. ...

September 6, 2026 Â· 8 min Â· 1541 words Â· SpaghettiCoder

Docker vs Podman: Differences and Which to Choose

Docker and Podman run the same images with the same commands. What separates them is architecture: Podman has no background daemon and runs rootless by default, while Docker brings the mature tooling, Docker Desktop, and first-class Compose. Below, the differences that actually affect your work — daemon, root, Compose, and pods. What is Podman? Podman (Pod Manager) is a tool for managing containers and pods, developed by Red Hat as an open source alternative to Docker. Its main feature? It doesn’t need a daemon running. ...

January 31, 2026 Â· 6 min Â· 1105 words Â· SpaghettiCoder

What Is a Docker Volume and How to Use It

Why a container loses its data when it restarts Write a row to a database running in a Docker container, stop the container, start it again: the row is gone. Every container gets its filesystem fresh from its image each time it starts. Anything the container itself writes — database files, uploads, logs — goes into a writable layer that is thrown away when the container is removed. A Docker volume is how you keep that data outside the container, where it survives. ...

January 31, 2026 Â· 6 min Â· 1160 words Â· SpaghettiCoder

What Is Docker and What Is It Used For

What Docker actually does Docker is an open source platform that packages an application with everything it needs to run — code, libraries, runtime, configuration — into a container that behaves the same on any machine. Moving house makes the trade-off concrete. You have two options: Carry all your belongings loose, hoping they arrive intact Put everything in organized, labeled boxes that are easy to move Docker does exactly this with software applications: it “packages” them into containers that contain everything they need to run. ...

January 31, 2026 Â· 4 min Â· 842 words Â· SpaghettiCoder

What Is Kubernetes and What Is It Used For

What Kubernetes does One Docker container on one machine is easy to run by hand. Fifty containers across ten machines — restarting them when they crash, moving them when a machine dies, splitting traffic between them, updating them without downtime — is not. Kubernetes (shortened to K8s) is the system that does that managing for you. What Is Kubernetes? Kubernetes is an open-source platform for container orchestration. Google created it in 2014 based on 15 years of running containers at scale, and the Cloud Native Computing Foundation (CNCF) maintains it now. ...

January 31, 2026 Â· 8 min Â· 1533 words Â· SpaghettiCoder