-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
disable path overlap validation flag #10943
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
Welcome @Fsero! |
Hi @Fsero. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
441b7bf
to
ce87884
Compare
385038c
to
3cdcd47
Compare
From the K8S official resources, it will be useful to add a link here that covers the specs and KEP for any ingress-controller, to deal with duplicate routing rule factors like identical hostname and identical path. |
7cd5ea9
to
a671012
Compare
I'm not sure about adding footguns like this to the configuration. With that said, we can add it but disable it as default, so the cluster admin has to choose to allow it consciously. It may be in the check overlap function, but can you ensure this dumps out a warning in the admission logs? Can you add an e2e test about this with it enabled and disabled? |
/kind feature |
Hi, is there an update on this? We're running into this exact issue and merging this PR would solve it. |
I believe that this use case has practical significance. Please resolve the conflicts. |
done @tao12345666333 |
d90d036
to
f23eb2f
Compare
lets wait a bit more on this, i will discuss that with @rikatz when we both have a time |
We can add it to the list for our next community meeting. @strongjz |
hey! any news on this? thanks so much |
What's the hesitation on this? It seems super valuable to me -- happy to provide more feedback about why if that'd be helpful! |
Sorry for the long delay. As I replied before, I think this case has practical significance. @Fsero @airhorns You can join the community meeting next time or post details here. |
My use case is described here: #10820 -- in order to make that change, we needed to manually remove the validating webhook in k8s which felt quite risky, make the change, then add it back after removing the duplicates. I can confirm the actual controller was fine with the duplicate resources. I had an ingress resource that had multiple host names, which locked me in to using the same set of ingress-nginx annotations for each. I wanted to start customizing some annotations for various hostnames, like turning on consistent hashing for a subset of customer domains, or adjusting the rate limit for big tenants up, but I couldn't split the ingress into one ingress resource per hostname without this flag. Can I provide any more info? |
This would be so incredibly useful. |
6d4077a
to
b8d00ff
Compare
let's see if i can explain an use case, imagine you have a company with several teams deploying microservices, there is a good amount of traffic in the service and in the ingress, and due to an internal change you want to transfer the service from team foo to team bar. Original microservice offered two endpoints /apple and /banana and team bar will get ownership of /banana while /apple will remain managed by foo. you can setup this scenario in a local kind (I actually created one with make dev-env) and try to apply the following manifest
bar team members have read this part of the documentation of ingress nginx and thought that would be very neat to create an ingress and deploy the service for some local test and allow the original service to handle the traffic so when everything is ready foo team just need to edit one-ingress object and remove the /banana path and team bar will start receiving traffic with 0 downtime. but when someone in bar tries to apply the manifest it finds the following error
for most cases that might be a valid protection but when you want to achieve zero downtime traffic migrations between ingress objects is counterproductive. This is the purpose of this PR give an opt-in flag that allows maintainers to bypass this and only this validation without disabling the rest of admission validations that are still useful. |
3685df7
to
08b08ec
Compare
## What this PR does / why we need it: In kubernetes#5651 there was a request to throw an error when there are two ingresses defining the same host and path, which was implemented as part of the validation webhook. Despite of this there are clear rules on the ingress controller that describes what the controller would do in [such situation (the oldest rule wins)](https://github.com/kubernetes/ingress-nginx/blob/main/docs/how-it-works.md?plain=1#L27) Some users are relying on this validation behaviour to prevent misconfigurations, but there are use cases where allowing it, maybe temporarily, is helpful. Those use cases includes: - Splitting large ingresses objects in smaller ones kubernetes#10820 - Moving ingress objects between namespaces without downtime (like when you transfer an ingress from team A that owns namespace A to team B that owns namespace B) kubernetes#10090 <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [X] New feature (non-breaking change which adds functionality) - [ ] CVE Report (Scanner found CVE and adding report) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation only ## Which issue/s this PR fixes It might help with kubernetes#10820 <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## How Has This Been Tested? building an image and testing it in a local cluster, will update later with some real life scenarios <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> ## Checklist: - [X] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [X] I've read the [CONTRIBUTION](https://github.com/kubernetes/ingress-nginx/blob/main/CONTRIBUTING.md) guide - [X] I have added unit and/or e2e tests to cover my changes. - [X] All new and existing tests passed. Change-Id: I9d4124d1c36876b06d63100cd10988eaf2f41db9
08b08ec
to
e9664c2
Compare
What this PR does / why we need it:
In #5651 there was a
request to throw an error when there are two ingresses defining the same
host and path, which was implemented as part of the validation webhook.
Despite of this there are clear rules on the ingress controller that
describes what the controller would do in such situation (the oldest
rule wins)
Some users are relying on this validation behaviour to prevent
misconfigurations, but there are use cases where allowing it, maybe
temporarily, is helpful. Those use cases includes:
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
CVE Report (Scanner found CVE and adding report)
Breaking change (fix or feature that would cause existing functionality to change)
Documentation only
Which issue/s this PR fixes
fixes #10820
fixes #10090
How Has This Been Tested?
building an image and testing it in a local cluster, will update later
with some real life scenarios
Checklist:
Change-Id: I9d4124d1c36876b06d63100cd10988eaf2f41db9