Skip to content

atenet: every Envoy socket binds 0.0.0.0 and neither gateway Service is dual-stack #910

Description

@ygao-g

Sub-task of #246, per bowei's concrete steps: "Fixing the Envoy bind to include IPv6 addresses." Needs #845 for somewhere to test it.

Problem

Socket Where Today
router ingress :8080 / :8443 router/xds.gobuildListener, buildHttpsListener 0.0.0.0
router Envoy admin :9901 manifests/ate-install/atenet-router.yaml 0.0.0.0
egress Envoy admin :15000 manifests/ate-install/atenet-egress.yaml 0.0.0.0
egress :443 CONNECT listener same 0.0.0.0
atenet-router, atenet-egress Services both manifests no ipFamilyPolicy → SingleStack

IPv6-only cluster — the pod never starts. The kubelet probes a pod on its only address, so the startup probe against the egress admin port is refused. atenet-egress crashlooped for 14h on a v6-only kind cluster while Envoy itself started fine and logged admin address: 0.0.0.0:15000:

Startup probe failed: Get "http://[fd00:10:244::18]:15000/ready": connect: connection refused

Dual-stack cluster — the pod is healthy and half the data path is dark. The router answers on its Service's IPv4 ClusterIP and on nothing at all for IPv6. The missing ipFamilyPolicy compounds it: even with a :: listener the Service only hands out one ClusterIP.

Two socket shapes, two fixes

Worth writing down, because side by side the two look inconsistent:

  • Ingress listeners keep the 0.0.0.0 primary and gain an additional :: address on the same port, ipv4_compat: false. Setting it would clear IPV6_V6ONLY and collide with the primary already bound to that port, and Envoy rejects the whole listener when an additional address fails to bind — that takes down all ingress, not just the v6 half.
  • The two admin sockets and the egress :443 listener are single sockets, so they bind :: with ipv4_compat: true. The flag is load-bearing: dataplane.go health-checks the router admin over http://127.0.0.1:9901/ready, and the egress ext-proc drainer dials 127.0.0.1:15000, where envoydrain.go reads a refusal as "Envoy already exited" and skips the drain silently.
  • Both Services get ipFamilyPolicy: PreferDualStack — Prefer, not Require, which fails Service creation outright on a single-stack cluster.

No behaviour change on IPv4-only: the ingress primary is untouched, PreferDualStack is a no-op there, and a host without IPv6 simply has no second socket to bind.

Not in scope

These leave both gateways IPv4-only for outbound resolution — material for bowei's step 3:

I have a fix working on an IPv6-only kind cluster and will open a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions