feat: introduce EndpointHostname in BTP to set hostname field in Endpoint#8606
feat: introduce EndpointHostname in BTP to set hostname field in Endpoint#8606zhuoyang wants to merge 19 commits into
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…vice backend Signed-off-by: Teo Zhuo Yang <zteo@moneylion.com>
Signed-off-by: Teo Zhuo Yang <zteo@moneylion.com>
841aaa6 to
806e05f
Compare
|
@guydc can you please take a look at this PR? |
Signed-off-by: zhuoyang <zhuoyang98@gmail.com>
Signed-off-by: Teo Zhuo Yang <zteo@moneylion.com>
f43fb70 to
6cb6abc
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8606 +/- ##
==========================================
+ Coverage 74.33% 74.38% +0.05%
==========================================
Files 244 244
Lines 38774 38808 +34
==========================================
+ Hits 28823 28868 +45
+ Misses 7953 7944 -9
+ Partials 1998 1996 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Teo Zhuo Yang <zteo@moneylion.com>
Signed-off-by: Teo Zhuo Yang <zteo@moneylion.com>
|
/retest |
|
can someone approve my test run again? |
Signed-off-by: Teo Zhuo Yang <zteo@moneylion.com>
|
i think the test is okay now, just some flaky e2e test (?) |
|
Hi @zhuoyang ! Thanks for picking this up.
|
|
Thanks for the feedback @guydc!
Since this is more of a HTTPRoute/Envoy Cluster level change rather than rule level change, maybe we should expose this under a different settings? Currently the hostname will be added to the endpoint if one of the rule has hostname.type set to
If we were to use |
Good point. Since the scope of the change is indeed wider than just traffic routed through, maybe this warrants a knob in in BTP that determine the "hostname" value:
Maybe we can add a flag to IR like "useHostname", always true for backend with hostname, only true for service in some cases (maybe relates to previous point). XDS would only consume the hostname in some cases. |
|
alternatively, I think we could just not utilize |
Would that work in case there are multiple backendrefs to different services? In that case, only the final endpoint selected by the cluster would hold the correct hostname. |
I didn't think of this case, yeah I don't think it would work. |
| } | ||
|
|
||
| if usesBackendHostRewrite(httpFiltersContext.URLRewrite) { | ||
| t.applyServiceBackendHostnames(allDs) |
There was a problem hiding this comment.
Should this stay scoped to route rewrite instead of mutating DestinationEndpoint.Hostname?
Signed-off-by: Teo Zhuo Yang <zteo@moneylion.com>
Signed-off-by: Teo Zhuo Yang <zteo@moneylion.com>
51ffcc2 to
648c036
Compare
The Service GVK fallback and its associated tests are unrelated to the endpointHostname BTP feature introduced in this PR. Signed-off-by: Teo Zhuo Yang <zteo@moneylion.com>
Signed-off-by: Teo Zhuo Yang <zteo@moneylion.com>
|
gentle bump on this |
|
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. Please feel free to give a status update now, ping for review, when it's ready. Thank you for your contributions! |
| // If unset, no hostname is attached to Kubernetes Service endpoints. | ||
| // | ||
| // +optional | ||
| EndpointHostname *BackendEndpointHostname `json:"endpointHostname,omitempty"` |
There was a problem hiding this comment.
doesnt the HTTPRouteFilter or Backend resource solve this use case
What type of PR is this?
Introduce EndpointHostname in BTP, to set hostname field in Endpoint
What this PR does / why we need it:
Currently HTTPURLRewriteFilter
hostname.type: Backenddoesn't work for backend pointing to k8s service, this PR will introduce the functionality to add k8s service FQDN to endpoint'shostnamefield.Which issue(s) this PR fixes:
Fixes #7984
Release Notes: Yes