Port, Socket, Reverse Proxy, JVM, Pod, SIGTERM: Backend Words Before the Deep Dives

October 1, 2026 · How It Actually Works: Real Systems as State Machines (part 1)

▶ Watch on YouTube & subscribe to The Stack Underflow

Your browser asks a small bookstore site for GET /books/42. The request travels to NGINX, which passes it to a Java app running in a container, inside a Kubernetes pod. Every step has a name, and in the deep-dive videos those names come fast. This primer gives you each word once, on one map, with what it is, why it exists, and the word it is most often confused with.

The one-line version: a request finds a device (IP), a service (port), and a waiting socket (bind + listen); a Java process answers it; Kubernetes checks it with probes and stops it with SIGTERM, then SIGKILL.

Last verified against the IETF RFCs, the Linux man pages, the Java specifications, kubernetes.io and nginx.org: 1 October 2026. The video’s definitions were checked on 29 September 2026; the version-sensitive ones (Kubernetes grace period, probe behaviour, NGINX’s default balancing method, Linux backlog semantics) were re-checked today.

One picture, one peg per word

The video hangs every word on one picture: a big office building with a mailroom and phone lines. The pegs are analogies, memory aids, not definitions. The right-hand column is the actual definition, and where a peg breaks down the video says so (we repeat the important limits below).

WordMemory peg (analogy)What it actually is
Client / serverthe caller / the one who picks upA client opens a connection to send requests; a server accepts connections and sends responses. These are roles per connection, not machines
IP addressthe street addressA number that identifies a device on an IP network
Portthe room numberA number that identifies one application service on that device. HTTPS defaults to 443; our Java app uses 8080
TCP connectionthe phone callA connection-oriented, reliable, in-order byte stream between two programs
Socketthe handsetIn the TCP standard, an IP address joined with a port. A connection is identified by a pair of sockets. In code, “socket” also names the program’s handle for one end
TLSthe sealed envelopeRuns on top of TCP; designed to prevent eavesdropping, tampering and message forgery. HTTPS is HTTP over TLS
SNIthe name on the envelopeServer Name Indication: the site name the client sends in the TLS client hello, so one address can host many sites
HTTP requestthe order formA method and target (GET /books/42), then name/value headers, then an optional body
HTTP responsethe reply slipA three-digit status code, headers and usually a body
Status codethe stamp on the reply2xx success, 3xx redirection, 4xx client error, 5xx server error
Keep-alivestaying on the lineReusing one connection for several requests and responses (HTTP/1.1’s default “persistent connection”)
Reverse proxythe front deskA gateway that receives requests as if it were the site and forwards them to servers behind it
Load balancerthe desk rotationSpreads requests over several copies of an app. NGINX’s default method is round-robin
Bind / listenthe name on the door / the phone switched onbind() assigns an address to a socket; listen() marks it passive, ready to accept connections
Backlogcallers on holdOn Linux, the length of the queue of fully established connections not yet accepted by the app
Process / threadthe office with its own filing cabinet / a worker sharing itA process has its own memory; threads live inside a process and share its memory and open files
JVMthe translatorAn abstract computing machine with its own instruction set; it runs class files, not the Java language
Classthe instruction sheetA named unit of Java code, compiled into a class file of bytecode plus a symbol table
JAR / classpaththe binder / the shelf listA ZIP-based file bundling many files; the classpath is a list of directories, JARs and ZIP archives to search for classes
Class loaderthe librarianFinds a class’s binary form by name and creates the class inside the JVM
Image / containerthe flat-pack kit / the assembled officeAn image is a ready-to-run package; a container is an isolated process started from it
Podthe shared suiteThe smallest deployable unit in Kubernetes: one or more containers sharing network and storage
Liveness / readiness”are you awake?” / “open for visitors?”Liveness failures restart the container; readiness failures stop traffic, with no restart
SIGTERM / SIGKILLclosing time / the power cutSIGTERM can be caught, so shutdown steps can run; SIGKILL cannot be caught, blocked or ignored
Exit codethe note on the doorThe number reported when a process ends; 0 means success

Reaching the server

An IP address picks the device and a port picks the service on it. You need both, because one machine runs many programs. TCP then sets up a connection before any data moves and gives both sides a reliable, in-order stream of bytes.

The word socket is used two ways, and the video keeps them apart. In the TCP standard (RFC 9293) a socket is an address that includes a port; a connection is identified by a pair of sockets, one at each end. In code, a socket is the file descriptor your program uses for one end, the thing you call bind() on.

TLS protects the connection; SNI tells the server which site the client wants, inside the TLS client hello. The common confusion is SNI vs the HTTP Host header: SNI travels in the handshake, and Host is an HTTP header sent after it.

Where the pegs break: one device can have several IP addresses, and TLS detects and rejects tampering; it can’t make interference physically impossible, which is why the peg says “sealed”, not “tamper-proof”.

Inside an HTTP exchange

A request starts with a method and a target, then headers (name/value pairs), then an optional body. GET asks for a representation of the resource, so it normally has no body; RFC 9110 says a body in a GET has no generally defined meaning. The path (/books/42) is not the URL: the URL also holds the scheme and host.

The response carries the status code, headers and usually a body. The code is a short summary; the body is the content. Error responses can carry a body too, usually explaining the error.

The 4xx/5xx split matters in the NGINX video: a 4xx says the client seems to have erred; a 5xx says the server has erred or cannot perform the request. 502 Bad Gateway and 504 Gateway Timeout come back there.

Keep-alive is the behaviour of reusing one connection, the default in HTTP/1.1, where Connection: close ends it after the response. Don’t confuse it with the Keep-Alive header, an older timeout hint that HTTP/2 and HTTP/3 prohibit.

The proxy and the app’s front door

A reverse proxy is set up by the site, in front of its servers. RFC 9110 calls it a gateway. A forward proxy is the opposite: chosen by the client. A load balancer chooses among several copies of an app. A reverse proxy can forward to just one server; NGINX in the video does both jobs.

For NGINX to connect, the Java app must already be waiting, which takes two system calls:

socket()  → a handle
bind()    → claim port 8080           (name on the door)
listen()  → accept connections        (phone switched on)
            backlog = queue of established, not-yet-accepted connections
accept()  → hand one connection to the app (not covered in the primer)

The usual confusion: backlog vs worker threads. The backlog is a queue in the operating system, before the app accepts. Threads do the work after a connection is accepted. The backlog meaning above is Linux’s (since Linux 2.2, per listen(2)); other systems may differ, and what happens when the queue fills is out of scope for this primer.

Inside the Java app

A process has its own private memory; a thread is a path of execution inside it, sharing memory and open files with the other threads. Two processes are walled off; two threads in one process see the same memory.

The JVM knows nothing of the Java language, only the class file format, which is why other languages can run on it. The java command starts a JVM, loads a class, and calls its main method. A class is the definition; an object is one instance of it, created at run time.

A JAR is a ZIP-based file whose manifest can name the main class. The classpath is the search list. With java -jar, the JAR is the source of all user classes and other classpath settings are ignored. A class loader is the code that does the finding: the JVM supplies the bootstrap loader, and programs can add loaders that fetch classes from other places. Classpath = list of places; class loader = the code that finds and creates the class.

Running it on Kubernetes

An image packages the app with everything it needs; a container is an isolated process started from it. Images are immutable: to change the app, build a new image and recreate the container. Unlike real flat-pack, one image can build many containers.

A pod is the smallest unit Kubernetes deploys and manages: one or more containers sharing storage and network, always scheduled together. Containers in a pod share one IP address and port space, which is why the peg says “shared suite”: one street address, so each office needs its own room number. One container per pod is the most common case.

The kubelet, the agent on each node, runs the probes:

Probe failsWhat Kubernetes does
Liveness, more times than the configured toleranceThe kubelet restarts the container
ReadinessThe pod’s IP is removed from the EndpointSlices of matching Services, so they stop sending it traffic. Nothing restarts

When a pod is deleted, the container runtime sends TERM to process 1 in each container (many runtimes send the image’s STOPSIGNAL instead, if one is defined). The default terminationGracePeriodSeconds is 30 seconds; once it expires, KILL goes to any remaining processes. SIGTERM can be caught, so a Java app can run its shutdown steps; SIGKILL cannot be caught, blocked or ignored, so no cleanup runs.

Exit codes: 0 means success. By shell convention, a process ended by signal N is reported as 128 + N, so SIGTERM (15) shows as 143 and SIGKILL (9) as 137. The signal is what was sent; the exit code is what is reported afterwards.

Pause & Prove

1. Your pod’s readiness probe keeps failing, but its liveness probe passes. Does Kubernetes restart the container, and what happens to its traffic?

  • A. It restarts the container. Tempting, because “probe failing” sounds like “broken”. Restarts come only from too many liveness failures.
  • B. No restart; the pod stops receiving Service traffic. ✓ A failing readiness probe removes the pod’s IP from the EndpointSlices of matching Services. The container keeps running and can come back once readiness passes.
  • C. Kubernetes deletes the pod. Neither probe deletes pods.
  • D. Nothing changes until liveness also fails. Readiness acts on its own: traffic stops as soon as it fails.

2. Kubernetes stops your pod. Which signal can your Java app catch to run its shutdown steps? (Community poll)

  • SIGTERM ✓ Kubernetes sends it first, and it can be caught, so the JVM’s shutdown sequence runs.
  • SIGKILL. Sent after the grace period (30 s by default) to anything still running. It cannot be caught, blocked or ignored.
  • Both. Only SIGTERM can be caught.
  • Neither. SIGTERM is exactly the signal meant to let a process clean up.

3. Peg drill

Say the peg before reading it: port → the room number · backlog → callers on hold · SIGTERM → closing time · class loader → the librarian · pod → the shared suite.

Before / after this video

Sources

Change notes

  • 1 Oct 2026: first published.

Not affiliated with or endorsed by F5 (NGINX), Oracle, the Cloud Native Computing Foundation or any other company or project named here. Found a mistake? Tell us in the video’s comments and we’ll correct this page.

Found this useful? The deep version lives on YouTube — new breakdowns of how AI dev tools actually work, weekly.

Subscribe on YouTube →

Prefer email? Get the free newsletter: one failure, traced step by step, about once a week.