Skip to content

endpoint.aether.io/protocol: tcp is silently downgraded to http on the kubernetes registry backend #878

Closed

Description

@bpalermo

Found while building the kind e2e harness for issue #868 (the TCPRoute leg). Sibling of
#877: same class of failure (accepted, then silently inert), different cause.

What happens

registry/cni.go accepts endpoint.aether.io/protocol: "tcp" on a pod and registers the
service under PROTOCOL_TCP. On the kubernetes registry backend — the chart default
(registrar.registryBackend) — that registration then goes nowhere:

// registry/internal/k8s/kubernetes.go
func (r *KubernetesRegistry) ListEndpoints(ctx, service, protocol) (...) {
    if protocol == registryv1.Service_PROTOCOL_TCP {
        return nil, nil
    }

ListAllEndpoints does the same. The comment is explicit that this is deliberate (every
managed pod is a mesh-inbound HTTP endpoint there, and returning the same pods under TCP
used to collapse every service to a TCP-only entry — a real bug that was fixed this way).

The user-visible consequence is the problem: the registrar's generator sees the service
only under the HTTP protocol, stamps aether.io/app-protocol: http on the generated mesh
Service, the agent's capture reconciler classifies it HTTP, and no TCP floor chain is
built
— so there is nothing for a TCPRoute/TLSRoute to replace and L4 routing is
inert. No warning anywhere. Observed directly:

NAME       IP               PROTO      # kubernetes backend, pods annotated protocol: tcp
l4-front   10.120.126.198   http
l4-a       10.120.47.106    http
l4-b       10.120.169.130   http

NAME       IP              PROTO       # same manifests, etcd backend
l4-front   10.120.62.255   tcp
l4-a       10.120.83.180   tcp
l4-b       10.120.28.43    tcp

Why it matters

A user on the default backend can annotate pods protocol: tcp, apply a TCPRoute, see
Accepted=True with ResolvedRefs=True, and get plain HTTP routing with no diagnostic.
The whole of proposal 018 Phase 3b is quietly unavailable on that backend.

Suggested fix

Either surface it or reject it:

  • have the registrar log a WARN (and/or count) when a pod registers under PROTOCOL_TCP
    on a backend whose ListEndpoints cannot serve that protocol; and/or
  • have the pod-mutating webhook / CNI reject endpoint.aether.io/protocol: tcp when the
    configured backend is kubernetes; and
  • document the precondition in docs/workload-requirements.md and proposal 018.

Filed from the #868 PR2 work; the harness there works around it by running etcd.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions