-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement support for URL and Host Header Rewrite for Application Load Balancer #4396
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
Implement support for URL and Host Header Rewrite for Application Load Balancer #4396
Conversation
Hi @andreybutenko. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
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.
/lgtm
/approve
Looking at test failures |
…d Balancer * Implement support for RegexValues in conditions annotation * Implement support for RegexValues in ingress spec paths * Add `alb.ingress.kubernetes.io/use-regex-path-match` annotation * Update `buildPathPatternsForImplementationSpecificPathType` to treat spec path as regex when annotation is "true" * Implement transforms annotation * Implement `buildTransforms` to get transforms from `transforms.${svc-name}` annotation * Implement `buildSDKTransforms` to marshall transforms * Add interface for transforms model * Update enhanced backend, `ListenerRuleManager`, `buildListenerRules`, `matchResAndSDKListenerRules` to handle transforms * Rename `resLRDesiredActionsAndConditionsPair` to `resLRDesiredRuleConfig`, extend to support transforms property * Update `matchResAndSDKListenerRules` and related helpers to support transforms property * Implement `CompareOptionForTransform` to compare transforms objects * Add and update unit tests * Misc * Add documentation for URL Rewrite * Add client-side validation to prevent mixing Values and RegexValues for host-name and path-pattern conditions * Remove leading slash from regex rule path * Implement host regex value support
5ab8fb1
to
08cbc9d
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andreybutenko, shraddhabang, zac-nixon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Implement support for URL and Host Header Rewrite for Application Load Balancer
Motivation
This PR adds AWS Load Balancer Controller support for 1/ URL and Host Header Rewrite, and 2/ regex rule conditions.
Usage in LBC
Transforms
Added
alb.ingress.kubernetes.io/transforms.${transforms-name}
annotation, which provides a method for specifying transforms on Ingress spec.Example transform to remove the leading
/api/
from request paths:Example transform to replace
example.com
withexample.org
from request host headers:Regex rule conditions (annotations)
Extended
alb.ingress.kubernetes.io/conditions.${conditions-name}
to support newregexValues
property.HTTP header condition using regex values:
Path condition using regex values:
Host header condition using regex values:
Regex rule conditions (ingress spec)
Added
alb.ingress.kubernetes.io/use-regex-path-match
annotation, which configures whether HTTP paths in the Ingress specification should be evaluated using regex.pathType: ImplementationSpecific
. HTTP paths usingpathType: Exact
orpathType: Prefix
are not affected by this annotation./
must precede the regex. The leading/
will be removed from the regex.Annotation:
Ingress rule path:
With this configuration, the rule condition regex value will be
^/api/(.+)$
as the leading/
is removed from the regex.Details
alb.ingress.kubernetes.io/use-regex-path-match
annotationbuildPathPatternsForImplementationSpecificPathType
to treat spec path as regex when annotation is "true"buildTransforms
to get transforms fromtransforms.${svc-name}
annotationbuildSDKTransforms
to marshall transformsListenerRuleManager
,buildListenerRules
,matchResAndSDKListenerRules
to handle transformsresLRDesiredActionsAndConditionsPair
toresLRDesiredRuleConfig
, extend to support transforms propertymatchResAndSDKListenerRules
and related helpers to support transforms propertyCompareOptionForTransform
to compare transforms objectsIssues
Checklist
README.md
, or thedocs
directory)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯