-
Notifications
You must be signed in to change notification settings - Fork 672
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
disableCompression: Expose configuration to toggle Envoy GZIP compression on the responses #6546
base: main
Are you sure you want to change the base?
Conversation
Hi @chaosbox! Welcome to our community and thank you for opening your first Pull Request. Someone will review it soon. Thank you for committing to making Contour better. You can also join us on our mailing list and in our channel in the Kubernetes Slack Workspace |
…jectcontour#6543) Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3.3.0 to 3.4.0. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](docker/setup-buildx-action@d70bba7...4fd8129) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Signed-off-by: chaosbox <ram29@bskyb.com>
…ponse compression Signed-off-by: chaosbox <ram29@bskyb.com>
The Contour project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to the #contour channel in the Kubernetes Slack |
Ping |
# Conflicts: # .github/workflows/build_main.yaml # .github/workflows/build_tag.yaml # .github/workflows/prbuild.yaml
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.
I've included suggestions inline for some linter nags (link).
Please add the new disableCompression
option in "Configuration File" chapter in site/content/docs/main/configuration.md.
Please add also a changelog file.
}, | ||
ResponseDirectionConfig: &envoy_filter_http_compressor_v3.Compressor_ResponseDirectionConfig{ | ||
CommonConfig: &envoy_filter_http_compressor_v3.Compressor_CommonDirectionConfig{ | ||
ContentType: []string{ |
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.
Possible alternative approach could be to leave the compressor filter in the chain but disable it by setting default to false
in ResponseDirectionConfig.CommonConfig.Enabled
Enabled: &envoy_config_core_v3.RuntimeFeatureFlag{
// If compression is enabled add compressor filter
DefaultValue: wrapperspb.Bool(!b.disableCompression),
RuntimeKey: "contour.compression.response.enabled",
},
but since we do not have "per route" setting, which would override the default, it make sense to me that the whole filter is excluded from the chain when disabled, like suggested in this PR currently.
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.
Yes, given
since we do not have "per route" setting
the thought in this PR is to work at the level of the whole filter. The functionality could be extended as described above if needed in future but that would best be left to another PR.
Thanks very much for the feedback @tsaarni 🙇 we'll have a look at this and try to get back with updates as soon as possible. |
Many thanks for taking the time to provide the lint fixes. We'll update the docs and add the changelog as soon as possible. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6546 +/- ##
=======================================
Coverage 81.76% 81.77%
=======================================
Files 133 133
Lines 15944 15954 +10
=======================================
+ Hits 13037 13046 +9
- Misses 2614 2615 +1
Partials 293 293
|
619ac16
to
16f72d7
Compare
Co-authored-by: Tero Saarni <tero.saarni@est.tech> Signed-off-by: Geoff Macartney <geoff.macartney@sky.uk>
Co-authored-by: Tero Saarni <tero.saarni@est.tech> Signed-off-by: Geoff Macartney <geoff.macartney@sky.uk>
Co-authored-by: Tero Saarni <tero.saarni@est.tech> Signed-off-by: Geoff Macartney <geoff.macartney@sky.uk>
Co-authored-by: Tero Saarni <tero.saarni@est.tech> Signed-off-by: Geoff Macartney <geoff.macartney@sky.uk>
Co-authored-by: Tero Saarni <tero.saarni@est.tech> Signed-off-by: Geoff Macartney <geoff.macartney@sky.uk>
This change is solely a formatting change and does not change any of the text of the table Signed-off-by: Geoff Macartney <geoff.macartney@sky.uk>
Signed-off-by: Geoff Macartney <geoff.macartney@sky.uk>
Signed-off-by: Geoff Macartney <geoff.macartney@sky.uk>
Hello @tsaarni I have made the changes to the documentation you mentioned. The first commit 934ca48 is a pure format change to tidy the table borders; the diff therefore looks worse than it is, but is more readable with whitespace diff comparison turned off. The actual addition of the flag to the docs is a one-liner in 2efb693. |
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.
Looks good! Just small documentation comments.
// DisableCompression disables GZIP compression HTTP filter from the default Listener filters | ||
// Setting this true will enable Envoy skip "Accept-Encoding: gzip,deflate" request header and always return uncompressed response |
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.
// DisableCompression disables GZIP compression HTTP filter from the default Listener filters | |
// Setting this true will enable Envoy skip "Accept-Encoding: gzip,deflate" request header and always return uncompressed response | |
// DisableCompression disables GZIP compression HTTP filter from the default Listener filters. | |
// Setting this true will enable Envoy skip "Accept-Encoding: gzip,deflate" request header and always return uncompressed response. |
@@ -0,0 +1 @@ | |||
Add disableCompression boolean flag to disable GZIP compression HTTP filter from the default Listener filters. |
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.
The changelog entry could mention where the flag can be found
Add disableCompression boolean flag to disable GZIP compression HTTP filter from the default Listener filters. | |
Add disableCompression boolean flag in the ContourConfiguration CRD and in configuration file to disable GZIP compression HTTP filter, forcing Envoy to always return uncompressed response. |
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.
sorry for commenting so late in the process but I think given that there are a lot of compression algorithms supported by envoy. Some of them much better than gzip
like zstd
I think we might want to change the api to allow the user to choose the compression algorithm and have an option called nocompression
that disables it
@davinci26 that's an interesting idea. It goes beyond what was mentioned in #310 which -- although it's far from a formal design process (so early in contour's lifecylce) -- is at least some semblance of a "blessing" of the API change in this PR. If we were to go for the alternative API you proposed (which is IMO richer/better overall), would it require going through the proposal process since it's not something that has been (afaik) so far envisioned/discussed? |
Signed-off-by: Geoff Macartney <geoff.macartney@sky.uk>
For #6511
This PR adds,
Related #310, there had been mentions about disabling compression, the ticket we had raised shows the reason where disabling compression can bring cost benefits.