Skip to content

Conversation

@ymesika
Copy link
Contributor

@ymesika ymesika commented Dec 10, 2025

Description

This PR is basically adapting the behavior of the KGW_DNS_LOOKUP_FAMILY setting on the static cluster that has the service VIPs endpoint.
It uses the AdditionalAddresses to add as sorted list of addresses based on the settings mode.
By default the mode is V4_PREFERRED which adds the IPv4 as the first addresses followed by the IPv6 (if exist).

E.g. of an output cluster:

"cluster": {
      "@type": "type.googleapis.com/envoy.config.cluster.v3.Cluster",
      "name": "echo.echo_echo.echo_8080",
      "type": "STATIC",
      "connect_timeout": "5s",
      "metadata": {},
      "load_assignment": {
       "cluster_name": "echo.echo_echo.echo_8080",
       "endpoints": [
        {
         "lb_endpoints": [
          {
           "endpoint": {
            "address": {
             "socket_address": {
              "address": "240.240.0.13",
              "port_value": 8080
             }
            },
            "additional_addresses": [
             {
              "address": {
               "socket_address": {
                "address": "2001:2::d",
                "port_value": 8080
               }
      ...

Fixes #13084

Change Type

/kind fix

Changelog

Support DNS lookup family settings in the ingress-use-waypoint cluster config

Additional Notes

Copilot AI review requested due to automatic review settings December 10, 2025 13:31
@gateway-bot gateway-bot added kind/fix Categorizes issue or PR as related to a bug. release-note labels Dec 10, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements DNS lookup family support for ingress-use-waypoint cluster configurations in the waypoint plugin. It adapts the existing KGW_DNS_LOOKUP_FAMILY setting behavior to static clusters by sorting addresses based on IP family preferences (IPv4/IPv6) and using Envoy's AdditionalAddresses field to maintain the ordered list.

Key changes:

  • Added DNS lookup family-aware address sorting for static waypoint clusters
  • Restructured endpoint creation to support primary + additional addresses
  • Added comprehensive unit tests for the address sorting logic

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pkg/kgateway/extensions2/plugins/waypoint/plugin.go Added sortAddressesByDnsLookupFamily function to sort addresses by IP family preference, refactored claEndpoint to support multiple addresses via AdditionalAddresses, and updated processIngressUseWaypoint to use sorted addresses
pkg/kgateway/extensions2/plugins/waypoint/plugin_test.go Added comprehensive unit tests for sortAddressesByDnsLookupFamily covering all DNS lookup family modes (V4_PREFERRED, V6_ONLY, V4_ONLY, AUTO, ALL) and edge cases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Yossi Mesika <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/fix Categorizes issue or PR as related to a bug. release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No IPv4 preferred when using ingress-use-waypoint

2 participants