An application moved to Docker in a hurry runs on the host network, leaving its internal services exposed to the internet. Redesign the application's networking to restrict external and internal access and harden the setup.
Once you start running applications in Docker, you need to understand how traffic gets to, from, and between containers. Learn Docker networking from the ground up by solving problems you'd run into while containerizing real applications.
A local registry and a kind cluster run on the same Docker host but on separate networks. Learn how to connect them by attaching a running container to an additional Docker network.
A containerized application uses separate frontend and backend networks, but its database can still reach the internet. Make the backend network internal while keeping the application's access to external services.
A reverse proxy, application, and its database share one Docker network. Split the setup across two bridge networks, connecting the application to both so the proxy can reach the application but not the database.
Two preview deployments of the same application share a Docker network, so each application can reach the other preview's database. Learn how to isolate groups of containers with separate bridge networks while keeping their configuration identical.
Containers on the default bridge network can reach each other only by IP address. Learn how to create a user-defined bridge network, connect containers by name, and inspect the DNS magic that makes it work.
Repeatable kubectl exercises for ClusterIP, NodePort, headless, ExternalName, and LoadBalancer Services, Service and Pod DNS names, and port-forwarding.
An MQTT broker only accepts plain connections on localhost, but every client must connect over TLS on port 8883. Practice adding a sidecar container to a Deployment: HAProxy terminates TLS for the broker and gets its configuration and its certificate from a ConfigMap and a Secret.
When a data volume fails to mount at boot, the service that keeps its data there may start anyway and write to the root filesystem. Practice making a systemd service depend on its data disk, so a failed mount won't bring down the whole server.
A Docker container cannot reach a service running on the host because the firewall is blocking the connection. Learn how to troubleshoot container-to-host connectivity and allow the traffic without exposing the service to the network.
A Go app needs credentials to download a private module during its Docker build. Learn how to supply them without exposing them in image layers or the build cache.
Firewall rules added with the iptables command disappear when the server reboots, and the ports they protect can become exposed again. Learn how to make iptables rules persistent so that they are restored every time the server boots.
Firewall rules added with the nft command disappear when the server reboots, and the ports they protect can become exposed again. Learn how to make nftables rules persistent so that they are restored every time the server boots.
A container port published on a server's internal IP is still reachable from the external network. Learn how to restrict access with firewall rules without disrupting legitimate connections.
The management VPN is down, but you urgently need SSH access to a datacenter server that is still reachable through its application network. Find an alternative path to SSH using a routing trick and Linux's weak end host behavior.
On a dual-homed Linux server, a service bound to one network's IP address may still be reachable from another network. Learn how to prevent this unexpected access without disrupting legitimate connections.
Practice using 'kubectl debug' to troubleshoot Kubernetes Pods when 'kubectl exec' isn't enough. Learn how to inspect processes, access files, and work around security restrictions using ephemeral containers.
Learn how to edit a file in a distroless container that runs as a non-root user in a Kubernetes namespace that enforces the baseline Pod Security Standard.
A payment service subscribes to payment requests through NATS. Run the checkout team's test script as a Job in the checkout namespace, with the required settings, and make sure the payment request arrives.
On a dual-homed Linux server, a service bound to the IP address of one interface may still accept connections that arrive through the other interface. Learn how to reach such a service through an interface it doesn't listen on, using a routing trick.
A freshly rolled out Deployment has its Pods stuck in ImagePullBackOff, and the catalog page it serves returns 503. Read what the cluster reports about the failed pulls, find out why the image does not pull, and get the Pods running.
I finally added dynamic social preview images to my site, and they cost me close to $0/mo. Here is the design I ended up with after several iterations, in case you need the same thing.
Learn how to access a service bound to localhost of the Docker host from a bridge-networked container, without exposing the service to the local network or disabling network isolation.
Learn how to access services running on the Docker host from a bridge-networked container, without hardcoding host IP addresses or disabling network isolation.
A stock Django + Strawberry GraphQL service ships with five common weaknesses. Probe each one from the terminal, fix it in the real project, and watch the lab confirm the remediation against the live endpoint.
Play a security researcher: identify the hosts a black-box container keeps making encrypted HTTPS calls to, route them through a MITM proxy, fake the certificate, and see what the container sends over the network.
Sometimes you need an app to talk to a different backend, but its configuration is unknown or the destination address is hard-coded. Practice overriding hostname resolution for a single Docker container to redirect its requests without modifying the app or rebuilding its image.
node-01 is due for maintenance, and it hosts two of the three checkout-api replicas. Add a PodDisruptionBudget so the drain can never take checkout below two available replicas, then drain the node.
Run a Deployment under the container runtime's seccomp profile, roll out a custom profile to the worker nodes, and fix a profile that blocks a syscall the application needs.
The platform team is rolling out Pod Security Admission. A monitoring agent is already blocked, the storefront team needs a staged rollout, and payments must move to the strictest level without losing its running service.
A distroless container serves a debug interface on its own loopback address. Can you reach this debug endpoint using nothing but standard Docker commands?
You are containerizing the dev workflows of a legacy Python service and you need to find out which external services its test suite talks to. Can you think of an easy way to do it?
Ad-hoc containers are a handy way to run command-line tools without installing them on the host. Use one to access a production Redis server and turn off a feature flag. But beware of the gotcha: the production server can only be tunneled to the localhost.
Explore the container networks of a freshly installed Docker host: find the default network, its subnet and gateway, and the Linux interface behind it.
A common setup for small deployments: two servers (VM or bare-metal), each with a public and a private IP. The app listens on the public port but wants to talk to Redis over the private network. Can you set it up?
Build a Kubernetes operator for a small Pet API, first as a 15-line bash loop and then as a Go controller with controller-runtime. Every Pet gets a Pod to live in, gets hungry as time passes, and runs away if nobody feeds it. Along the way, you'll see how the reconcile loop works.
Build a CustomResourceDefinition for a small Pet API one layer at a time, and see how much the API server does with it on its own. By the end, it rejects invalid Pets, fills in defaults, keeps status separate, and prints useful columns. No controller and no code needed.
node-02 is back from a kernel upgrade but still shows Ready,SchedulingDisabled, and the Pods that can only run on it are stuck in Pending. Bring the node back into service and get the workload running, without touching the workload itself.
A storefront needs eight replicas, and the platform team wants them split down the middle between the two availability zones. An uneven split must be refused by the scheduler rather than quietly tolerated.
The storefront APIs are served through a Traefik Ingress with TLS and two path rules. Reproduce that configuration with a Gateway and an HTTPRoute on the same hostname, cut traffic over to it, and retire the Ingress.
A web app is listening inside a container, but the browser can't reach its IP address. Recreate the container so the app is available on port 80 of the Docker host.
Practice authenticating to an HTTP API from the command line using both a username and password and a bearer token, and learn a couple of tricks along the way.
Practice one of the most common command-line combinations for HTTP API access: fetch a JSON response with curl and pipe it into jq to pretty print, reshape, or get only the relevant parts.
Practice calling HTTP APIs from the command line: send JSON bodies with POST, PUT, and PATCH, upload a file, delete a resource, and read the status codes the server answers with.
Learn the basics of accessing HTTP APIs from the command line: call different endpoints, read the response body, headers, and status code, follow redirects, and request an alternative representation of a server resource.
An internal service started receiving requests from unexpected IP addresses. Identify the unexpected sources and find out which workloads and teams are behind them.
An internal service started receiving requests from unexpected IP addresses. Identify the unexpected sources and find out which systems are behind them.