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

support Host header rewrites per-service #4002

Closed
skriss opened this issue Aug 30, 2021 · 7 comments · Fixed by #5195
Closed

support Host header rewrites per-service #4002

skriss opened this issue Aug 30, 2021 · 7 comments · Fixed by #5195
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@skriss
Copy link
Member

skriss commented Aug 30, 2021

Currently, Contour supports rewriting the Host header at the route level only. It's explicitly disallowed at the per-service level, because Envoy did not historically support it. As of Envoy 1.19.0, however, setting host_rewrite_literal for an individual weighted cluster is now supported (see https://www.envoyproxy.io/docs/envoy/v1.19.0/version_history/current#new-features), so Contour should expose this functionality.

@skriss skriss added kind/feature Categorizes issue or PR as related to a new feature. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor. labels Aug 30, 2021
@xaleeks xaleeks added this to Unprioritized in Contour Project Board via automation Sep 20, 2021
@xaleeks
Copy link

xaleeks commented Sep 20, 2021

seems nice to have, tagging it v1.20 tentatively

@xaleeks xaleeks moved this from Unprioritized to 1.20 release (candidates) in Contour Project Board Sep 20, 2021
@sunjayBhatia sunjayBhatia added this to the 1.20.0 milestone Nov 2, 2021
@adnanhb
Copy link

adnanhb commented Nov 29, 2021

Hi, I would like to work on this feature if it is still unassigned. Can someone assign it to me?

@sunjayBhatia
Copy link
Member

assigned @adnanhb, let us know if you have any questions about how to proceed!

@sunjayBhatia sunjayBhatia removed the lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor. label Dec 7, 2021
@skriss skriss moved this from 1.20 release (candidates) to 1.21 release (candidates) in Contour Project Board Jan 4, 2022
@skriss skriss modified the milestones: 1.20.0, 1.21.0 Jan 4, 2022
@sunjayBhatia
Copy link
Member

@adnanhb are you still working on this? let us know if you need anything from us or if we should reassign this issue

@adnanhb
Copy link

adnanhb commented Apr 14, 2022

@adnanhb are you still working on this? let us know if you need anything from us or if we should reassign this issue

Sunjay, i have completed the implementation, just need to get around to testing it. I will revert back with a PR soon.

@skriss skriss modified the milestones: 1.21.0, 1.22.0 May 3, 2022
@skriss skriss modified the milestones: 1.22.0, 1.23.0 Jul 21, 2022
@sunjayBhatia sunjayBhatia removed this from 1.21 release (candidates) in Contour Project Board Jul 25, 2022
@skriss skriss removed this from the 1.23.0 milestone Jul 25, 2022
@skriss
Copy link
Member Author

skriss commented Dec 16, 2022

The latter does not allow the Host header to be rewritten (https://github.com/projectcontour/contour/blob/main/internal/dag/policy.go#L124-L126), however now that Envoy supports it on a per-Service/Cluster basis via host_rewrite_literal (see https://www.envoyproxy.io/docs/envoy/v1.19.0/api-v3/config/route/v3/route_components.proto#envoy-v3-api-field-config-route-v3-weightedcluster-clusterweight-host-rewrite-literal), Contour can allow it.

@skriss
Copy link
Member Author

skriss commented Dec 16, 2022

cc @vmw-yingy @fangfpeng

fangfpeng added a commit to fangfpeng/contour that referenced this issue Mar 17, 2023
Updates projectcontour#4002

Signed-off-by: Fang Peng <fpeng@vmware.com>
@skriss skriss assigned fangfpeng and unassigned adnanhb Mar 17, 2023
@skriss skriss added this to the 1.25.0 milestone Mar 17, 2023
sunjayBhatia pushed a commit that referenced this issue Mar 22, 2023
Closes #4002

Signed-off-by: Fang Peng <fpeng@vmware.com>
yangyy93 pushed a commit to projectsesame/contour that referenced this issue Mar 27, 2023
yangyy93 pushed a commit to projectsesame/contour that referenced this issue Mar 27, 2023
)

Closes projectcontour#4002

Signed-off-by: Fang Peng <fpeng@vmware.com>
Signed-off-by: yy <yang.yang@daocloud.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants