-
Notifications
You must be signed in to change notification settings - Fork 351
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
dataclients/kubernetes: append predicates to routes of Ingress/RouteGroup having specific annotation #3328
Merged
MustafaSaber
merged 1 commit into
master
from
apply-predicates-on-a-set-of-ingresses-with-annotation
Dec 5, 2024
Merged
dataclients/kubernetes: append predicates to routes of Ingress/RouteGroup having specific annotation #3328
MustafaSaber
merged 1 commit into
master
from
apply-predicates-on-a-set-of-ingresses-with-annotation
Dec 5, 2024
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
MustafaSaber
added
the
major
moderate risk, for example new API, small filter changes that have no risk like refactoring or logs
label
Dec 4, 2024
MustafaSaber
force-pushed
the
apply-predicates-on-a-set-of-ingresses-with-annotation
branch
from
December 4, 2024 16:48
c71990f
to
5839d17
Compare
…roup having specific annotation The main purpose of this change is to allow skipper operators to dynamically add predicates to routes based on annotations key-value pairs in Kubernetes resources (metadata.annotation). This provides more flexibility in routing configuration without modifying the core Ingress or RouteGroup definitions. Key changes: - Added KubernetesAnnotationPredicates option & `-kubernetes-annotation-predicates` flag for public hostnames, which can be specified multiple times. - Added KubernetesEastWestRangeAnnotationPredicates option & `-kubernetes-east-west-range-annotation-predicates` flag for internal hostnames, which can be specified multiple times. - Modified Ingress and RouteGroup clients to apply annotation predicates depending on the host - Added test cases for new functionality Run & test with ```sh ➜ ./bin/skipper -kubernetes -kubernetes-annotation-predicates="zalando.org/traffic-disabled=true=False()" -kubernetes-east-west-range-annotation-predicates="zalando.org/traffic-disabled=true=False()" ➜ #or ➜ ./bin/routesrv -kubernetes -kubernetes-annotation-predicates="zalando.org/traffic-disabled=true=False()" -kubernetes-east-west-range-annotation-predicates="zalando.org/traffic-disabled=true=False()" ``` Having both flags with same value will append configured predicates to all routes of Ingress/RouteGroup resources annotated with `zalando.org/traffic-disabled: true`, routes defined in: * The `spec.rules` section of Ingress resources. * Routes specified using the `zalando.org/skipper-routes` annotation of Ingress resources. * The `spec.routes` section of RouteGroup resources. Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
MustafaSaber
force-pushed
the
apply-predicates-on-a-set-of-ingresses-with-annotation
branch
from
December 5, 2024 08:22
5839d17
to
948c27f
Compare
👍 |
1 similar comment
👍 |
MustafaSaber
deleted the
apply-predicates-on-a-set-of-ingresses-with-annotation
branch
December 5, 2024 08:48
This was referenced Dec 5, 2024
MustafaSaber
added a commit
to zalando-incubator/kubernetes-on-aws
that referenced
this pull request
Dec 9, 2024
* zalando/skipper#3271 * zalando/skipper#3283 * zalando/skipper#3284 * zalando/skipper#3285 * zalando/skipper#3281 * zalando/skipper#3282 * zalando/skipper#3294 * zalando/skipper#3293 * zalando/skipper#3292 * zalando/skipper#3291 * zalando/skipper#3288 * zalando/skipper#3300 * zalando/skipper#3301 * zalando/skipper#3290 * zalando/skipper#3328 * zalando/skipper#3319 * zalando/skipper#3325 * zalando/skipper#3310 * zalando/skipper#3307 * zalando/skipper#3322 * zalando/skipper#3326 * zalando/skipper#3289 zalando/skipper@v0.21.220...v0.21.224 follow up on #8574 Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
MustafaSaber
added a commit
to zalando-incubator/kubernetes-on-aws
that referenced
this pull request
Dec 9, 2024
* zalando/skipper#3271 * zalando/skipper#3283 * zalando/skipper#3284 * zalando/skipper#3285 * zalando/skipper#3281 * zalando/skipper#3282 * zalando/skipper#3294 * zalando/skipper#3293 * zalando/skipper#3292 * zalando/skipper#3291 * zalando/skipper#3288 * zalando/skipper#3300 * zalando/skipper#3301 * zalando/skipper#3290 * zalando/skipper#3328 * zalando/skipper#3319 * zalando/skipper#3325 * zalando/skipper#3310 * zalando/skipper#3307 * zalando/skipper#3322 * zalando/skipper#3326 * zalando/skipper#3289 zalando/skipper@v0.21.220...v0.21.224 follow up on #8574 Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
MustafaSaber
added a commit
to zalando-incubator/kubernetes-on-aws
that referenced
this pull request
Dec 9, 2024
* zalando/skipper#3271 * zalando/skipper#3283 * zalando/skipper#3284 * zalando/skipper#3285 * zalando/skipper#3281 * zalando/skipper#3282 * zalando/skipper#3294 * zalando/skipper#3293 * zalando/skipper#3292 * zalando/skipper#3291 * zalando/skipper#3288 * zalando/skipper#3300 * zalando/skipper#3301 * zalando/skipper#3290 * zalando/skipper#3328 * zalando/skipper#3319 * zalando/skipper#3325 * zalando/skipper#3310 * zalando/skipper#3307 * zalando/skipper#3322 * zalando/skipper#3326 * zalando/skipper#3289 zalando/skipper@v0.21.220...v0.21.224 follow up on #8574 Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Can you please also write in the description what "internal" hostname means? |
MustafaSaber
added a commit
to zalando-incubator/kubernetes-on-aws
that referenced
this pull request
Dec 9, 2024
* zalando/skipper#3271 * zalando/skipper#3283 * zalando/skipper#3284 * zalando/skipper#3285 * zalando/skipper#3281 * zalando/skipper#3282 * zalando/skipper#3294 * zalando/skipper#3293 * zalando/skipper#3292 * zalando/skipper#3291 * zalando/skipper#3288 * zalando/skipper#3300 * zalando/skipper#3301 * zalando/skipper#3290 * zalando/skipper#3328 * zalando/skipper#3319 * zalando/skipper#3325 * zalando/skipper#3310 * zalando/skipper#3307 * zalando/skipper#3322 * zalando/skipper#3326 * zalando/skipper#3289 zalando/skipper@v0.21.220...v0.21.224 follow up on #8574 Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
major
moderate risk, for example new API, small filter changes that have no risk like refactoring or logs
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.
The main purpose of this change is to allow skipper operators to dynamically add predicates to routes based on annotations key-value pairs in Kubernetes resources (metadata.annotation). This provides more flexibility in routing configuration without modifying the core Ingress or RouteGroup definitions.
Key changes:
-kubernetes-annotation-predicates
flag for public hostnames, which can be specified multiple times.-kubernetes-east-west-range-annotation-predicates
flag for internal hostnames (hostnames defined by-kubernetes-east-west-range-domains
), which can be specified multiple times.Run & test with
Having both flags with same value will append configured predicates to all routes of Ingress/RouteGroup resources annotated with
zalando.org/traffic-disabled: true
, routes defined in:spec.rules
section of Ingress resources.zalando.org/skipper-routes
annotation of Ingress resources.spec.routes
section of RouteGroup resources.