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 #4089

Closed
brianehlert opened this issue Jul 11, 2023 · 1 comment · Fixed by #4127
Closed

Support regex path for Ingress resource #4089

brianehlert opened this issue Jul 11, 2023 · 1 comment · Fixed by #4127
Assignees
Labels
backlog Pull requests/issues that are backlog items proposal An issue that proposes a feature request
Milestone

Comments

@brianehlert
Copy link
Collaborator

brianehlert commented Jul 11, 2023

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:

  • introduce an annotation
  • add unit tests

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.

@brianehlert brianehlert added proposal An issue that proposes a feature request backlog Pull requests/issues that are backlog items labels Jul 11, 2023
@shaun-nx shaun-nx added the story label Jul 12, 2023
@shaun-nx shaun-nx added this to the v3.3.0 milestone Jul 12, 2023
@jjngx
Copy link
Contributor

jjngx commented Jul 20, 2023

#4127

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 proposal An issue that proposes a feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants