-
Notifications
You must be signed in to change notification settings - Fork 480
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
GEP: Add support for cookie in the HTTPRouteMatch API #2891
Comments
/assign @lianglli |
Thanks for this @lianglli, this seems like another GEP, if a small one. |
/kind gep |
Do we have the implementation status in the different proxy implementations ? I think any proposed API should start with the list of proxies that provide the feature already - we can't define APIs for things that don't exist ( in terms of data plane processing), and it is very difficult to evaluate a proposal without having the prior art and status. Cookie is a particularly tricky one - there are multiple cookies, they have structure, etc. There are other structured headers - Baggage, (new) Authorization - and RFCs around structured fields. It is certainly NOT suitable for prefix/exact or regex matching. |
AFAIK, Envoy doesn't support cookie match. Nginx supports cookie match via its variable: https://nginx.org/en/docs/http/ngx_http_core_module.html#var_cookie_. APISIX, which is a gateway built upon Nginx, overcomes some of the limitations by extending Nginx's variable system. The cookie name in APISIX can be case-sensitive and contain |
Pls. check the "## Prior Art" and "## References" of this PR 2926 specifically. Moreover, the |
The RFC6265 defines the HTTP Cookie specifically. For this PR 2926, the The |
This is very much needed! |
Yes, I will add a comment about GEP-2891: HTTP Cookie Match in the #3103 asap. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
What would you like to be added:
It would be great if HTTPRouteMatch had a field to select a HTTP route by matching HTTP request cookies.
Moreover, a new match type "list" is added. Matches if the value of the cookie with name field is present in a list of strings.
This match type "list" can be applied to serving HTTPHeaderMatch and HTTPQueryParamMatch as well.
Similar specifications can be seen in ingress like ingress-nginx (ref: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#canary) nginx.ingress.kubernetes.io/canary-by-cookie, kubernetes-ingress (ref: https://docs.nginx.com/nginx-ingress-controller/configuration/virtualserver-and-virtualserverroute-resources/#condition) and tengine-ingress (ref: https://tengine.taobao.org/document/ingress_routes.html).
Why this is needed:
Just like HTTP route based on header and query parameter is common, it is useful to match a cookie-name and cookie-value of the request for the specific backends.
Cookies are used to maintain state and identify specific users. It is an essential part of the HTTP request.
The Cookie header has multiple cookie-pair which contains the cookie-name and cookie-value.
E.g., backend service wants to select specific users for measuring the effectiveness of advertising campaigns. However, the cookies are used to maintain state and identify specific users. Hence, based on the following http rule, the http requests with cookie name "unb" and cookie value in a list of strings (i.e., 2426168118, 2208203664638, 2797880990, 70772956, 2215140160618) will be routed to the service "http-route-canary-campaign:7001".
Cookies, headers and query parameter are common techniques used in a canary release.
E.g., based on the following http route, the HTTP requests with cookie "gray=true" will be route to the canary service "http-site-canary:80" specifically.
If this requires a GEP, I would be like to start working on it.
The text was updated successfully, but these errors were encountered: