yceffort
◆ SERIES 6 POSTS

Kubernetes for Frontend Developers

A record of opening up and measuring Kubernetes in a kind cluster, so that frontend developers running SSR do not have to treat it as a black box

README

Once you run SSR, about half of the problems with deployment, traffic, and memory happen outside the application, in Kubernetes. Yet for frontend developers, Kubernetes tends to stay a black box of manifests that someone else wrote and that you copy. This series opens that black box one layer at a time.

Each part does not stop at explaining concepts. The rule was to reproduce and measure everything with a kind cluster and a real Next.js app: tracing the 1.5GB that disappeared in an image layer, following through iptables rules how curl reaches a ClusterIP that exists nowhere, and stacking fixes one layer at a time until the errors leaking during a rolling deploy reach zero.

The first part serves as a concept map for the whole series, so if Kubernetes is new to you, reading in order is recommended. If you are dealing with a specific problem, each part is written to stand on its own.

06 ITEMS

All posts

in order
01

A Kubernetes Concept Map for Frontend Developers: From Pods to Autoscalers

#kubernetes#devops
The Kubernetes vocabulary and structure that frontend developers running SSR actually encounter, organized in the order of real work: cluster structure, deploys, pod state and resources, the traffic path, and autoscaling.
Updated
22 min read
02

How My Next.js App Becomes a Pod: A Record of Opening Up Containers and Pods

#kubernetes#docker#devops
The same Next.js app produced one 1.72GB image and one 208MB image. This post traces the missing 1.5GB back through the layers, and verifies with PIDs and cgroup files that a container is an isolated process.
Updated
19 min read
03

How Does Traffic Reach My Pod? From ClusterIP to port-forward

#kubernetes#networking#devops
A Service's ClusterIP is an IP attached to no machine, so how does a curl request reach a pod? In a kind cluster, this post inspects iptables rules and conntrack, EndpointSlice, cluster DNS and ndots, Gateway, and port-forward in turn to follow the path a request takes.
27 min read
04

How Do Pods Terminate? Measuring the Causes and Fixes of Deploy-Time Errors

#kubernetes#devops#debugging
Even a deploy that changes not a single line of code still fails requests. I tagged every failed request during rolling deploys by type and timestamp, found four causes, and added fixes one at a time until failures reached zero. The post also checks the actual Next.js shutdown code and the real CrashLoopBackOff restart intervals.
Updated
20 min read
05

Autoscaling Is Automatic but Not Instant: HPA's Timeline, Measured Segment by Segment

#kubernetes#devops#web-performance
Raise traffic 12x and it takes 31.5 seconds for a new pod to receive its first request, 22.5 of them spent before the HPA notices the load. The post also covers the conditions under which the autoscaler stops responding in the five minutes right after a deploy, why scale-down comes down in steps, why memory-based HPA does not fit Node apps, and scaling ahead of time with KEDA.
25 min read
06

Why Is Your Node.js Pod That Size? Sizing Measured Firsthand, from NODE_OPTIONS to Pod Count

#memory#nodejs#kubernetes
I added one GC tuning flag to the same workload and peak RSS rose from 201MB to 593MB while the live data stayed the same. This post measures V8 New Space directly to trace why, and proposes three criteria frontend developers can use to size a Node.js pod.
Updated
45 min read