Skip to content

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

@jjngx

Description

@jjngx

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

Metadata

Metadata

Assignees

Labels

backlogPull requests/issues that are backlog itemsenhancementPull requests for new features/feature enhancements

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions