← Back to Pull requests

Honor listen-ip-addresses for the stats listener #1481

Open
unknown opened this pull request with 335 lines diff across 4 files
View on GitHub
unknown unknown commented on Nov 02, 2026 02:36 UTC
Author

Proposed change

Addresses #1474.

The bootstrap stats listener currently binds to :: with ipv4_compat: true. This works with IPv4 networking when kernel IPv6 support is available, but still requires an AF_INET6 socket. Envoy fails at startup on hosts booted with ipv6.disable=1.

Move the port-9000 stats listener from the static bootstrap into LDS and use the existing config-kourier listen-ip-addresses setting, consistent with the application listeners:

  • Default: 0.0.0.0

  • IPv6: ::

  • Dual-stack: 0.0.0.0,::
  • Keep the loopback-only Envoy admin interface and service_stats cluster in the bootstrap. Preserve the existing route/method allowlist using a dedicated connection manager that does not inherit application external authorization, tracing, access logging, or PROXY protocol.

    Document the address setting and that stats become available after LDS configuration arrives. Gateway readiness/liveness already use the dynamic port-8081 listener.

    Tests included

    go test ./pkg/... passes locally.

    Unit tests exercise:

  • Default IPv4, IPv6, and dual-stack addresses in either order.

  • Stats listener presence in an empty-ingress snapshot.

  • Listener and connection-manager protobuf validation.

  • Isolation from application authorization, logging, and PROXY protocol settings.

  • Allowed methods/paths and rejection of other admin endpoints.

  • Rejection of an empty listen-address list.
  • Draft / merge blockers

  • Resolve and test rolling-upgrade compatibility. Old gateways still have the static stats listener on port 9000; delivering the new LDS listener to those gateways can conflict. Consider a bootstrap capability marker in node metadata and compatible snapshot selection. Also test new gateways against old controllers.

  • Add a Linux CI integration test using the real Envoy image with a test-only seccomp profile returning EAFNOSUPPORT for socket(AF_INET6, ...). Verify IPv4 sockets still work and IPv6 sockets fail, test bootstrap plus LDS delivery and IPv4 stats access, and use the old static-IPv6 bootstrap as a negative control.

  • Exercise IPv6 stats access with IPv6 available, retaining the support added in #1455.
  • An IPv4-only KinD network or the net.ipv6.conf.*.disable_ipv6 sysctls alone do not reproduce the missing AF_INET6 support. Seccomp would simulate the relevant socket failure; exact kernel-boot reproduction would require a VM booted with ipv6.disable=1.

    /kind bug

    ``release-note
    Kourier's stats listener honors config-kourier's listen-ip-addresses setting, defaulting to IPv4 without requiring kernel IPv6 support. Metrics become available after the gateway receives its LDS configuration.
    ``

    Diff: 335 lines (+251 / -84) across 4 files Reviewer: linkvt Review duration: 22326m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.42) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 335 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.348
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #1481"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.2% (MEDIUM) · Higher = larger blast radius
    42.2%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.1% · Safe to merge
    24.1%