I thought that using this plugin, I would like to create a rule with only the host header. The definition is as follows.
spec:
backend:
serviceName: fallback-nginx
servicePort: 80
rules:
- host: myapp1.example.com
http:
paths:
- backend:
serviceName: myapp1
servicePort: 80
However, path-pattern '/' is automatically added. I want to exclude the path-pattern from the rule, is it possible?
$ aws elbv2 describe-rules --rule-arns arn:aws:elasticloadbalancing:us-west-2:xxxxxx:listener-rule/app/xxxxxx
{
"Rules": [
{
"RuleArn": "arn:aws:elasticloadbalancing:us-west-2:xxxxxx:listener-rule/app/xxxxxx",
"Priority": "1",
"Conditions": [
{
"Field": "path-pattern",
"Values": [
"/"
]
},
{
"Field": "host-header",
"Values": [
"myapp1.example.com"
]
}
],
"Actions": [
{
"Type": "forward",
"TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:xxxxxx:listener-rule/app/xxxxxx"
}
],
"IsDefault": false
}
]
}
It's not possible, the ALB requires that a rule matches a path. Does this create an issue or is it just unexpected?
https://docs.aws.amazon.com/ja_jp/elasticloadbalancing/latest/APIReference/API_RuleCondition.html
ALB allows host-header only rule, path-pattern could omitted.
for example

Current situation If we want to use host name based routing using this plugin, we need to set /* to path-pattern for all. This means that we can only use half the maximum number of if matches.
I am also being affected by this issue. It appears this bug was introduced in #476 (first released as 1.0-beta.5) in this repo; kubernetes/ingress-nginx#2244 introduced the behavior for the nginx ingress controller, which works for nginx because the paths in nginx are prefixes, not exact matches or globs.
I can verify that path-less rules work in version 1.0-alpha.9, and I have reverted to that version to resolve the issue.
yeah totally a bug, was just fixed in #670
@bigkraig
The problem close to Issue was reviving.
I think that it is probably the following commit, "/*" is automatically added to it.
If there is no path-pattern or if "/ *" is specified for path-pattern, both actions are the same, but the upper limit (100) of the number of rules applicable to ALB has been affected. By specifying "/ *" automatically, host-based rules can only be created up to 50.
Most helpful comment
I am also being affected by this issue. It appears this bug was introduced in #476 (first released as
1.0-beta.5) in this repo; kubernetes/ingress-nginx#2244 introduced the behavior for the nginx ingress controller, which works for nginx because the paths in nginx are prefixes, not exact matches or globs.I can verify that path-less rules work in version
1.0-alpha.9, and I have reverted to that version to resolve the issue.