Skip to content
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

Support regex path for Ingress resource (minion - master) #4154

Closed
jjngx opened this issue Jul 26, 2023 · 0 comments · Fixed by #4200
Closed

Support regex path for Ingress resource (minion - master) #4154

jjngx opened this issue Jul 26, 2023 · 0 comments · Fixed by #4200
Assignees
Labels
backlog Pull requests/issues that are backlog items enhancement Pull requests for new features/feature enhancements
Milestone

Comments

@jjngx
Copy link
Contributor

jjngx commented Jul 26, 2023

Is your feature request related to a problem? Please describe.

This is a follow up story to the original issue.
We need to be able to specify path-regex on only selected minions.

Describe the solution you'd like

User is able to use annotations nginx.org/path-regex on selected minions only.

Each Ingress resource that is part of a master-minion pattern defines regular expression behavior for the paths within that Ingress need to be merged together so that each path uniquely retains its desired settings.

What we do not want is: the master Ingress causing regex to be enabled for all minion paths or any minion path regex impacting the regex settings of another minion.

Additional context

Full main story: issue

The VirtualServer / VirtualServerRoute resources properly support regular expressions for path.
Folks that rely on the Ingress resource would also like the benefit of being able to use regular expressions in paths.

This is complicated by the fact that the Ingress resource definition says that a path must being with a "/" and thus the regular expression pattern of beginning with a "" is tossed away by the K8s API if anyone attempts to place a regular expression directly in the path field of an Ingress.
Since the VirtualServer/VirtualServerRoute are owned by the NGINX Ingress Controller project, they support the possibility of containing a leading "
" which makes the object usage very intuitive.

The K8s community ingress controller works around the limitation of the K8s Ingress object by using a special annotation which inserts "~*" and prepends "^" in front of the path in the nginx.conf. While this is effective, it is a bit of magic that is the result of Ingress itself not supporting regex paths directly. More about this can be reviewed here: https://kubernetes.github.io/ingress-nginx/user-guide/ingress-path-matching/

The proposal is to implement support for regular expression paths with the Ingress object.
This would include:

This project primarily supports nginx.org/nginx.com annotations, except for one.
That is primarily based on history and to reinforce that the implementations are unique, and some capabilities may not be implemented in the exact same way.
I suggest that we stick with nginx.org annotations for this to reduce confusion between the two projects and that this project would be supporting annotations from multiple namespaces.
Even then; nginx.org is used for annotations that are supported with NGINX OSS as well as NGINX Plus, and nginx.com is for capabilities that are exclusive to NGINX Plus.

### Tasks
- [ ] https://github.com/nginxinc/kubernetes-ingress/issues/4201
- [x] https://github.com/nginxinc/kubernetes-ingress/issues/4206
@jjngx jjngx added the proposal An issue that proposes a feature request label Jul 26, 2023
@jjngx jjngx self-assigned this Jul 26, 2023
@jjngx jjngx added this to the v3.3.0 milestone Jul 26, 2023
@jjngx jjngx added the enhancement Pull requests for new features/feature enhancements label Jul 26, 2023
@brianehlert brianehlert added backlog Pull requests/issues that are backlog items and removed proposal An issue that proposes a feature request labels Jul 26, 2023
@jjngx jjngx linked a pull request Aug 9, 2023 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Pull requests/issues that are backlog items enhancement Pull requests for new features/feature enhancements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants