-
Notifications
You must be signed in to change notification settings - Fork 269
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
Add abstract per path config reader #663
Merged
Merged
Conversation
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
Add a backend's internal field `pathConfig` that holds per path configurations in a way haproxy can understand and use. Per path configurations will be added to the `[]Paths` field, simplifying the public interface. `pathConfig` is populated and data is deduplicated in an abstract way.
A small refactor in the annotation mapper to allow a direct reference to the per path configs. Most of the other methods should be removed after convert the annotation parsers.
jcmoraisjr
force-pushed
the
jm-path-config
branch
from
September 10, 2020 21:05
72ebb2e
to
837a6ba
Compare
remove legacy code used to deduplicate and redistribute per-path config in the annotation parser.
Change the name of the hash maps and support types to something one can understand its purpose. Annotation mapper has now two maps and the old naming was a bit confusing.
A small refactor to reuse the final `ConfigValue` data in both annotation mapper maps.
jcmoraisjr
changed the title
WIP: Add abstract per path config reader
Add abstract per path config reader
Sep 12, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Per path configuration is the ability to configure the same backend in distinct ways depending on the request uri, leading to less backend config colisions and more config flexibility. Currently this configuration is a manual and error prone process because haproxy doesn't provide the primitives needed to implement it in the way an ingress object was designed to operate.
This pr aims to provide an abstract implementation that reads per-path config from a
[]Paths
field, deduplicate and convert them in a way haproxy can use.This is the first step to configure other options which fits in the per-path context, and also move some configs from the frontend to the backend, leading to an even faster configuration on deployments with a high number (thousands) of distinct domains.
Tasks being implemented:
AuthHTTP
Cors
HSTS
MaxBodySize
RewriteURL
SSLRedirect
WAF
WhitelistHTTP