kubernetes / ingress-nginx

Ingress NGINX Controller for Kubernetes
https://kubernetes.github.io/ingress-nginx/
Apache License 2.0
17.55k stars 8.26k forks source link

ingress-controller could filter endpoints by a header in request. #9968

Open ivan-cai opened 1 year ago

ivan-cai commented 1 year ago

If nginx ingress-controller could filter endpoints by a header in request? (for example, label a=b to endpointslice, the requests of having header a=b can be routed to the a=b label endpoints)

k8s-ci-robot commented 1 year ago

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
longwuyuan commented 1 year ago

The ingress object of K8S routes based on hostname or path. Header based routing is not in the spec.

ivan-cai commented 1 year ago

@longwuyuan But nginx ingress-controller has extended a lot of capabilities through annotation. Routing traffic to specified endpoints by headers makes sense in some scenarios, similar to zone topology aware, but more general.

longwuyuan commented 1 year ago

True. And PRs for doing this are most welcome. But this is not a trivial task to carry out because the implications of this feature are global to the product functionalities. There are no resources for such a large rework.

Secondly this kind of usefulness , among others, is in the Gateway API. Please check Gateway API docs.

Also please wait for other comments. I may be completely wrong or things may change.

On Tue, 16 May, 2023, 7:30 am ivanscai, @.***> wrote:

@longwuyuan https://github.com/longwuyuan But nginx ingress-controller has extended a lot of capabilities through annotation. Routing traffic to specified endpoints by headers makes sense in some scenarios, similar to zone topology aware, but more general.

— Reply to this email directly, view it on GitHub https://github.com/kubernetes/ingress-nginx/issues/9968#issuecomment-1548858565, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGZVWWDLLPAA5FJP5WTRJLXGLNVRANCNFSM6AAAAAAYCDX74Q . You are receiving this because you were mentioned.Message ID: @.***>

github-actions[bot] commented 1 year ago

This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach #ingress-nginx-dev on Kubernetes Slack.

VladyslavKurmaz commented 9 months ago

FYI: https://viesure.io/nginx-ingress-controller/tech/