Port Contract and the Helm default() Trap
Five layers of config must agree on port numbers. Helm's default() silently fills in a wrong value. required() catches the mistake at deploy time.
The Five-Layer Config Chain
A containerized service with a port relay has five layers of config. Each layer must match its neighbors. A mismatch at any layer is silent: the pod starts, no error appears, but connections fail.
Two Helm values control everything. socat, Chrome, containerPort, and Service.targetPort all trace back to these two numbers.
The default() Trap
Helm default returns a fallback when a value is not set. If the fallback is valid but wrong, the template renders without error. The bug appears only at runtime.
default() vs required()
“In review, watch for
defaultfollowed by a different port number, a different image tag, or an empty string for a secret name. That is a landmine.”
References:
Related: see how the entrypoint starts socat that these values feed into, or go back to the series overview.