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

feat: set full URI for the envoy-gateway service using name and namespace #4533

Merged
merged 3 commits into from
Oct 26, 2024

Conversation

rajatvig
Copy link
Contributor

Signed-off-by: Rajat Vig rvig@etsy.com

What type of PR is this?

Sets the xdsServerHost in Kubernetes to be fully qualified Service Name using the namespace.

What this PR does / why we need it:

Instead of defaulting to envoy-gateway sets the xdsServerHost to be envoy-gateway.envoy-gateway-system.svc.cluster.local.

Release Notes: No

…pace

Signed-off-by: Rajat Vig <rvig@etsy.com>
@rajatvig rajatvig requested a review from a team as a code owner October 25, 2024 22:57
Copy link

codecov bot commented Oct 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.67%. Comparing base (6f5ae8e) to head (4cfe395).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4533      +/-   ##
==========================================
- Coverage   65.72%   65.67%   -0.05%     
==========================================
  Files         211      211              
  Lines       31669    31672       +3     
==========================================
- Hits        20813    20801      -12     
- Misses       9656     9668      +12     
- Partials     1200     1203       +3     

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

Signed-off-by: Rajat Vig <rvig@etsy.com>
@@ -132,6 +134,7 @@ func expectedProxyContainers(infra *ir.ProxyInfra,
TrustedCA: filepath.Join("/sds", common.SdsCAFilename),
},
MaxHeapSizeBytes: maxHeapSizeBytes,
XdsServerHost: ptr.To(fmt.Sprintf("envoy-gateway.%s.svc.%s", namespace, dnsDomain)),
Copy link
Contributor

Choose a reason for hiding this comment

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

can we use config.EnvoyGatewayServiceName here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@arkodg arkodg requested review from a team October 26, 2024 01:24
@zirain
Copy link
Member

zirain commented Oct 26, 2024

can you share more details about the benifit? reduce DNS pressure?

Signed-off-by: Rajat Vig <rvig@etsy.com>
@rajatvig
Copy link
Contributor Author

can you share more details about the benifit? reduce DNS pressure?

Yes. It would reduce the number of DNS resolve requests as just envoy-gateway traverses the full search path everytime.

The typical /etc/resolv.conf has ndots 5 and quite a few search paths varying on the Kubernetes setup.

You can test it out by running and comparing against a CoreDNS pod with logging turned on to see the diference in number of queries.

dig +search +short envoy-gateway AAAA
dig +search +short envoy-gateway.envoy-gateway-system.svc.cluster.local AAAA

We see
Screenshot 2024-10-26 at 12 21 15

Should add, this is not true when autopath @kubernetes and pods verified is on with CoreDNS. In our setup, however, we get arbitrary IPv6 address failures when we turn on autopath despite not using a dual stack cluster. The reason from what I have gathered in Go http/client defaults to requesting both IPv4 and IPv6 records all the time.

Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM thanks !

@arkodg arkodg merged commit 3e8730f into envoyproxy:main Oct 26, 2024
23 of 24 checks passed
@zirain
Copy link
Member

zirain commented Oct 29, 2024

@rajatvig looks like this broken xds_cluster dns reslove on IPv6 cluster?

zirain added a commit to zirain/gateway that referenced this pull request Oct 29, 2024
evankanderson pushed a commit to evankanderson/gateway that referenced this pull request Oct 29, 2024
…pace (envoyproxy#4533)

* feat: set full URI for the envoy-gateway service using name and namespace

Signed-off-by: Rajat Vig <rvig@etsy.com>

* Use the correct namespace and dnsdomain from Gateway config

Signed-off-by: Rajat Vig <rvig@etsy.com>

* Use constant from config

Signed-off-by: Rajat Vig <rvig@etsy.com>

---------

Signed-off-by: Rajat Vig <rvig@etsy.com>
evankanderson pushed a commit to evankanderson/gateway that referenced this pull request Oct 29, 2024
…pace (envoyproxy#4533)

* feat: set full URI for the envoy-gateway service using name and namespace

Signed-off-by: Rajat Vig <rvig@etsy.com>

* Use the correct namespace and dnsdomain from Gateway config

Signed-off-by: Rajat Vig <rvig@etsy.com>

* Use constant from config

Signed-off-by: Rajat Vig <rvig@etsy.com>

---------

Signed-off-by: Rajat Vig <rvig@etsy.com>
zirain added a commit to zirain/gateway that referenced this pull request Oct 30, 2024
…nd namespace (envoyproxy#4533)"

This reverts commit 3e8730f.

Signed-off-by: zirain <zirain2009@gmail.com>
zirain added a commit to zirain/gateway that referenced this pull request Oct 30, 2024
@zirain zirain mentioned this pull request Oct 30, 2024
7 tasks
zirain added a commit to zirain/gateway that referenced this pull request Oct 30, 2024
…nd namespace (envoyproxy#4533)"

This reverts commit 3e8730f.

Signed-off-by: zirain <zirain2009@gmail.com>
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.

3 participants