You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- <aname="conditions">`alb.ingress.kubernetes.io/conditions.${conditions-name}`</a> Provides a method for specifying routing conditions **in addition to original host/path condition on Ingress spec**.
366
414
367
415
The `conditions-name` in the annotation must match the serviceName in the Ingress rules.
368
416
It can be a either real serviceName or an annotation based action name when servicePort is `use-annotation`.
369
417
418
+
Condition values can be specified using *either*`values` or `regexValues`:
419
+
420
+
-`values`: Wildcard syntax, where `*` matches 0 or more characters, and `?` matches exactly 1 character.
421
+
422
+
`values` is supported for all condition types: `host-header`, `http-header`, `http-request-method`, `path-pattern`, and `source-ip`.
423
+
424
+
-`regexValues`: Regex syntax.
425
+
426
+
`regexValues` is supported for the following condition types: `host-header`, `http-header`, and `path-pattern`.
427
+
370
428
!!!warning "limitations"
371
429
General ALB limitations applies:
372
430
@@ -378,7 +436,7 @@ Traffic Routing can be controlled with following annotations:
378
436
379
437
Refer [ALB documentation](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-listeners.html#rule-condition-types) for more details.
380
438
381
-
!!!example
439
+
!!!example "Examples using `values`"
382
440
- rule-path1:
383
441
- Host is www.example.com OR anno.example.com
384
442
- Path is /path1
@@ -504,7 +562,7 @@ Traffic Routing can be controlled with following annotations:
504
562
!!!note
505
563
If you are using `alb.ingress.kubernetes.io/target-group-attributes` with `stickiness.enabled=true`, you should add `TargetGroupStickinessConfig` under `alb.ingress.kubernetes.io/actions.weighted-routing`
506
564
507
-
!!!example
565
+
!!!example "Example using target group stickiness config"
508
566
509
567
```yaml
510
568
apiVersion: networking.k8s.io/v1
@@ -552,6 +610,79 @@ Traffic Routing can be controlled with following annotations:
!!!warning "Considerations when using `regexValues`"
638
+
639
+
ALB does not support mixing `values` (wildcard syntax) and `regexValues` (regex syntax) for the same condition type.
640
+
641
+
In particular, when using the AWS Load Balancer Controller:
642
+
643
+
- By default, additional `path-pattern` conditions **must** use `values`.
644
+
645
+
This is because the AWS Load Balancer Controller automatically adds `path-pattern` conditions using `values` according to your [Ingress specification](../spec/).
646
+
647
+
To configure additional `path-pattern` conditions using `regexValues`, configure the [`alb.ingress.kubernetes.io/use-regex-path-match`](#use-regex-path-match) annotation. When this annotation is set to `"true"`, the AWS Load Balancer Controller can add `path-pattern` conditions with `regexValues`.
648
+
649
+
- If your [Ingress specification](../spec/) includes a `host` rule, additional `host-header` conditions **must** use `values`.
650
+
651
+
To configure `host-header` conditions using `regexValues`, use the `alb.ingress.kubernetes.io/conditions.${conditions-name}` annotation instead of Ingress specification rules.
652
+
653
+
In other words:
654
+
655
+
- When [`alb.ingress.kubernetes.io/use-regex-path-match`](#use-regex-path-match) is `"false"` (default value), for HTTP paths using `pathType: ImplementationSpecific`, additional `path-pattern` conditions can **only** use `values`.
656
+
- When [`alb.ingress.kubernetes.io/use-regex-path-match`](#use-regex-path-match) is `"true"`, for HTTP paths using `pathType: ImplementationSpecific`, additional `path-pattern` conditions can **only** use `regexValues`.
657
+
- If a ingress rule `host` is specified, additional `host-header` conditions can only use `values`.
658
+
659
+
660
+
- <aname="use-regex-path-match">`alb.ingress.kubernetes.io/use-regex-path-match`</a> Configure whether HTTP paths in your [Ingress specification](../spec/) should be evaluated using regex.
661
+
662
+
* This configuration only applies to HTTP paths using `pathType: ImplementationSpecific`. HTTP paths using `pathType: Exact` or `pathType: Prefix` are not affected by this annotation.
663
+
* A leading `/` must precede the regex. The leading `/` will be removed from the regex.
0 commit comments