Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable ipv4 compat mode for dual stack cluster support #5018

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tekulvw
Copy link
Contributor

@tekulvw tekulvw commented Jan 6, 2025

What type of PR is this?

Bug fix.

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #5017

Release Notes: Yes/No

@tekulvw tekulvw requested a review from a team as a code owner January 6, 2025 22:09
@@ -180,8 +180,9 @@ func buildXdsTCPListener(
},
}

if ipFamily != nil && *ipFamily == egv1a1.DualStack {
if ipFamily != nil && *ipFamily == egv1a1.DualStack || *ipFamily == egv1a1.IPv6 {
Copy link
Contributor

Choose a reason for hiding this comment

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

based on https://github.com/envoyproxy/gateway/pull/4817/files we shouldnt need this, because it should listen on ::

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only thing I'm aware of is that this block was added in that PR. If it was necessary to support DualStack family it follows (to me) that it would be necessary in a dual stack cluster. I don't know enough about xds/envoy to explain why.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on envoy docs this seems to be a required field for this use case (IPv6 single stack service on a dual stack IPv4 first cluster).

However, due to envoy defaults, this is likely only valid to set specifically for this usecase (IPv6 singlestack on dualstack cluster) and may break on a different usecase (IPv6 singlestack on IPv6 singlestack cluster).

listener: the ipv4_compat flag can only be set on Ipv6 address and Ipv4-mapped Ipv6 address. A runtime guard is added envoy.reloadable_features.strict_check_on_ipv4_compat and the default is true.

source

This leads me to believe this should be a separate setting in the EnvoyProxy config. Thoughts?

Copy link
Contributor Author

@tekulvw tekulvw Jan 7, 2025

Choose a reason for hiding this comment

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

Turns out that envoy.reloadable_features.strict_check_on_ipv4_compat was removed from envoy on a subsequent patch.

It seems to me this is a safe change to make.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Relevant Envoy PR

@tekulvw tekulvw force-pushed the ipv4-compat-dual-stack-cluster branch from d3bdebc to 50f693f Compare January 6, 2025 22:51
@tekulvw tekulvw changed the title Enable ipv4 compat mode for dual stack cluster support fix: enable ipv4 compat mode for dual stack cluster support Jan 7, 2025
@tekulvw tekulvw force-pushed the ipv4-compat-dual-stack-cluster branch from 6b6695a to c761f28 Compare January 7, 2025 22:40
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.69%. Comparing base (c534621) to head (56cf2bf).
Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5018      +/-   ##
==========================================
- Coverage   66.73%   66.69%   -0.04%     
==========================================
  Files         209      209              
  Lines       32058    32264     +206     
==========================================
+ Hits        21394    21520     +126     
- Misses       9385     9442      +57     
- Partials     1279     1302      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -180,8 +180,9 @@ func buildXdsTCPListener(
},
}

if ipFamily != nil && *ipFamily == egv1a1.DualStack {
if ipFamily != nil && (*ipFamily == egv1a1.DualStack || *ipFamily == egv1a1.IPv6) {
Copy link
Member

Choose a reason for hiding this comment

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

will this make it impossible to generate a pure IPv6 listener?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To my understanding, this flag allows envoy to respond to IPv4 requests when the listening address is ::. A pure IPv6 listener on a single stack IPv6 cluster should work, it seems the E2E tests confirm this though I haven't tested it personally.

Is a pure IPv6 listener possible on a dual stack cluster with this change? No. The alternative would be to introduce another parameter to the EnvoyProxy spec which allows this behavior.

@tekulvw tekulvw changed the title fix: enable ipv4 compat mode for dual stack cluster support [NOT READY] fix: enable ipv4 compat mode for dual stack cluster support Jan 8, 2025
@tekulvw tekulvw force-pushed the ipv4-compat-dual-stack-cluster branch from c761f28 to 189acd6 Compare January 8, 2025 08:37
@tekulvw
Copy link
Contributor Author

tekulvw commented Jan 8, 2025

I was entirely incorrect about the source of the ipv4_compat flag. The proxy deployment template is the only required change necessary to fix the issue I'm encountering (single stack IPv6 service on dual stack IPv4-first cluster).

@zirain this still does not consider a possibility for a pure IPv6 listener.

@tekulvw tekulvw force-pushed the ipv4-compat-dual-stack-cluster branch from 189acd6 to 6a7ae2c Compare January 8, 2025 08:40
@tekulvw tekulvw changed the title [NOT READY] fix: enable ipv4 compat mode for dual stack cluster support fix: enable ipv4 compat mode for dual stack cluster support Jan 8, 2025
@tekulvw tekulvw force-pushed the ipv4-compat-dual-stack-cluster branch from 6a7ae2c to 56cf2bf Compare January 8, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Single stack IPv6 on dual stack cluster not passing ready checks
3 participants