-
Notifications
You must be signed in to change notification settings - Fork 381
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
api: Support Server header transformations #2500
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
internal/gatewayapi/testdata/clienttrafficpolicy-suppress-envoy-headers.in.yaml
This file was deleted.
Oops, something went wrong.
140 changes: 0 additions & 140 deletions
140
internal/gatewayapi/testdata/clienttrafficpolicy-suppress-envoy-headers.out.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we discussed this in the community meeting today, here are some follow up questions
https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io/v1.HTTPHeaderFilter
suppressEnvoyHeaders
be represented with another name closer to the goal of the field such aspassThrough
etc ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. The
ResponseHeaderFilter
unconditionally adds/overwrites a header whose value is given in the filter. This feature'spassThrough
option will keep the value of the Server header provided by the upstream, and there's no way to express theappendIfAbsent
option withResponseHeaderFilter
.You meant
serverHeaderTransformation
, notsuppressEnvoyHeaders
, right?suppressEnvoyHeaders
has nothing to do with passing anything through and isn't the topic of this PR.I used the name of the underlying feature in Envoy Proxy for the
serverHeaderTransformation
field. I thinkpassThrough
isn't a good name - it's only one of three options, and is exactly the opposite of theoverwrite
option.I'm open to any other name you have that you think fits better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from a user perspective, (correct me if im wrong), what you're really trying to solve here is - hey envoy, dont add any new response headers like
x-envoy-*
orserver
we should come up with a name for this knob to define this opt in behavior
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about a knob called
addEnvoyResponseHeaders
, making adding envoy headers along withserver
as opt in, so we supress by defaultThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe istio/api#2240 will give a little help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for sharing this @zirain, this is super useful
how about removing this API and disabling
by default
and we can introduce APIs in the future to opt into this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, to summarise the above:
HeaderSettings
structure is removed, and the default behaviour becomes that theX-Envoy-
headers are removed and the Server header is defined aspassthrough
. This is done to try to effectively hide the presence of an Envoy Proxy between the client and the upstream target.X-Envoy
headers. This makes it harder for developers to perform certain tasks, for example when trying to measure latency with the x-envoy-upstream-service-time, or debugging various rewrite rules with the x-envoy-original-path header.How to proceed? Should I close this PR and create a new PR removing the
suppressEnvoyHeaders
option and implementing the behavioural changes listed here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @liorokman, agree with 1.
for 2. we can make a opt in API e.g.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to reflect this thread.
This PR changes the API and keeps the project building, a different PR will actually implement the feature.