Repository navigation
feat(mesh): add the TCP mesh port 18082 (037 Phase 2, Release A) - #890
Merged
Merged
Conversation
Release A of proposal 037 Phase 2: the control-plane half that makes
<svc>.<ns>.<mesh-domain>:18082 addressable and safe to dial BEFORE the agent
can serve it. Deliberately inert on its own.
- ProxyTCPOutboundPort = 18082, the mesh's well-known TCP spelling and the
L4 counterpart of ProxyOutboundPort. Free tree-wide when chosen (in-use
18xxx: 18001, 18008, 18009, 18021, 18054, 18080, 18081).
- The generated mesh Service exposes four ports: "mesh" 18081, "mesh-tcp"
18082, and name-only "http" 80 / "https" 443. The Services are
selectorless and hold no endpoints, so kube-proxy REJECTs an unclaimed
port -- an uncaptured scheme-default dial fails with ECONNREFUSED instead
of hanging in a CNI-dependent way.
- The scoped CNI rule redirects dport 18082 alongside 18081. This is what
makes :18082 work WITHOUT redirect-all, unlike a dial to a service's own
application port. UDP is deliberately NOT redirected for 18082: it is a
TCP spelling, and the UDP floor addresses backends by application port.
Why a second port rather than resolving the bare name by the service's
protocol: HTTP demuxes on the authority header, which carries its own port as
a string, so `http://<svc>/` is unambiguous without one. Raw TCP has no
authority -- its only demux key is the 5-tuple -- so it needs a port, and
without a well-known one the bare name's meaning would depend on whichever
protocol the service's PRIMARY port happened to be. A client's spelling would
change meaning when a service was re-annotated.
Also fixes a migration gap found while writing this: the generator's apply
path compared ANNOTATIONS alone and returned early, never touching
Spec.Ports. A mesh Service created before this change would have kept its
single "mesh" port forever, so the new spellings would have appeared only on a
fresh install -- the worst way to discover a missing migration. Ports now
converge, compared order-insensitively so an API-server reorder is not drift.
Interim safety, between Release A and B: the CNI redirects 18082 but no agent
chain matches destination_port 18082 yet, so a redirected connection falls to
the capture listener's passthrough, reaches the "mesh-tcp" Service port, and
is REJECTed by kube-proxy. Immediate ECONNREFUSED, not a hang or a silent
blackhole.
Negative control: dropping the Spec.Ports convergence fails
TestGenerator_ConvergesPortsOnExistingService with the pre-037 single-port
Service. The CNI test asserts the ENCODED dport (0x46a2) rather than merely
that a rule exists -- a rule built for the wrong port installs cleanly,
captures nothing, and looks identical to a working one. It caught a wrong
constant in its own first draft.
Not included, and why: the `port-protocols` annotation needs per-port data
that arrives with the proto field in Release B, so stamping a primary-port-only
form now would advertise a feature that does not work yet. The `=tcp` webhook
guard needs a mechanism this repo does not have -- see the PR.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
This was referenced Sep 21, 2026
bpalermo
added a commit
that referenced
this pull request
Sep 21, 2026
…#891) The guard was specified as "the pod-mutating webhook rejects =tcp until the chart's agent version supports it". It cannot do that job: - there is no pod VALIDATING webhook (the controller's /validate dispatches by Kind; pods reach only /mutate), and - it must know the agent version, whose only non-drifting source is a chart value set by the same release that ships the agent -- but within one helm upgrade the controller rolls BEFORE the agents, so a pod annotated in that window still registers as HTTP on an old agent's node. It narrows the window it exists for without closing it, and a gate that cannot fail in the case it was built for is decoration (#853). Replaced by the documented skew rule plus a loud WARN from the new agent, and the condition that would reopen the decision is stated. Also records Release A as shipped (#890), including the two items that moved: the port-protocols annotation defers to Release B where its data exists, and the Spec.Ports migration gap that Release A had to fix. Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr Co-authored-by: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposal 037 Phase 2, Release A — the control-plane half. Follows #889 (Phase 1). Deliberately inert on its own.
What ships
ProxyTCPOutboundPort = 18082— the mesh's well-known TCP spelling, the L4 counterpart ofProxyOutboundPort. Verified free tree-wide (in-use 18xxx: 18001, 18008, 18009, 18021, 18054, 18080, 18081).mesh18081,mesh-tcp18082, and name-onlyhttp80 /https443. These Services are selectorless and hold no endpoints, so kube-proxy REJECTs an unclaimed port: an uncapturedhttps://<svc>/fails withECONNREFUSEDinstead of hanging in a CNI-dependent way.:18082work without redirect-all, unlike a dial to a service's own application port. UDP is deliberately not redirected for 18082 — it's a TCP spelling, and the UDP floor addresses backends by application port.Why a second port at all
HTTP demuxes on the authority header, which carries its own port as a string — so
http://<svc>/is unambiguous without one. Raw TCP has no authority; its only demux key is the 5-tuple. Without a well-known TCP port, the bare name's meaning would depend on whichever protocol the service's primary port happened to be, so a client's spelling would change meaning when a service was re-annotated. That was the asymmetry this proposal exists to remove.A migration gap found while writing this
The generator's apply path compared annotations alone and returned early, never touching
Spec.Ports. A mesh Service created before this change would have kept its singlemeshport forever — the new spellings would have appeared only on a fresh install, which is the worst way to discover a missing migration. Ports now converge, compared order-insensitively so an API-server reorder isn't treated as drift (#135 is the same mechanism on the route table).Interim safety
Between Release A and B the CNI redirects 18082 but no agent chain matches
destination_port 18082yet. A redirected connection falls to the capture listener's passthrough, reaches themesh-tcpService port, and is REJECTed by kube-proxy — immediateECONNREFUSED, not a hang and not a silent blackhole.Negative controls
Spec.Portsconvergence failsTestGenerator_ConvergesPortsOnExistingServiceagainst a pre-037 single-port Service.0x46a2), not merely that a rule exists — a rule built for the wrong port installs cleanly, captures nothing, and looks identical to a working one. It caught a wrong constant in its own first draft.bazel build //...clean, 56 tests pass, lint clean. Nocharts/changes, so no Chart.yaml bump.Two Release A items deliberately NOT here
port-protocolsannotation. It needs per-port data that arrives with the proto field in Release B. Stamping a primary-port-only form now would advertise a feature that doesn't work yet.The
=tcpwebhook guard. The proposal calls for the pod-mutating webhook to reject=tcpuntil the agent supports it. Two problems worth deciding before building it:/validatedispatches by Kind (MeshConfig, HTTPFilter, EdgeConfig, EndpointPolicy, HTTPRoute); pods only have the/mutatepath. Rejecting from a mutating webhook works but is an odd shape.helm upgradethe controller rolls before the agents, so a=tcppod created in that few-minute window still registers as HTTP on an old agent's node.Given the guard can't fully close the window it exists for, the alternative is to drop it and rely on the documented skew rule (roll the agent before annotating) plus a loud WARN from the new agent when it sees
=tcp. That trades a silent downgrade for a documented ordering constraint. I'd rather decide that explicitly than build a gate that can't quite fail.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr