-
Notifications
You must be signed in to change notification settings - Fork 589
Add gateway_selector field to VirtualService for label-based gateway selection #3605
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
base: master
Are you sure you want to change the base?
Conversation
…selection This commit introduces a new `gateway_selector` field to the VirtualService API that allows selecting gateways using label selectors instead of explicit names, following the Kubernetes Service selector pattern. Changes: - Add GatewayReference message with name and selector fields - Add gateway_selector field to VirtualService (field number 7) - Update documentation with examples and usage patterns - Mark gateways and gateway_selector as mutually exclusive - Generate corresponding Go code and CRD definitions The new field enables dynamic gateway selection, reducing operational overhead when updating or replacing gateways across multiple VirtualServices. Fixes: #58426
|
Hi @prashanthjos. Thanks for your PR. I'm waiting for a github.com 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-sigs/prow repository. |
|
🤔 🐛 You appear to be fixing a bug in Go code, yet your PR doesn't include updates to any test files. Did you forget to add a test? Courtesy of your friendly test nag. |
|
@keithmattix, could you please let me know if there’s a specific reason the PR is labeled as do-not-merge/hold? |
|
Thanks for the PR. I understand the motivations but I don't think this is a good fit for Istio's APIs. We are primarily focusing around Gateway API, which does not support such a selector. Additionally, adding a selector introduces pretty substantial runtime and cognitive complexities to the project. |
|
+1 to @howardjohn I don't think it's a good fit from an API perspective, and I'm concerned about a malicious VirtualService creator can bind to a gateway with just labels and not explicitly (bypassing OPA or other admission control that may be watching the gateways: field) |
|
@howardjohn @keithmattix Thank you for your replies. How would you recommend solving the mentioned problem (i.e. changing Gateways without changing VirtualServices) using the current APIs? |
|
I would recommend changing the problem parameters to not require that you don't change the VirtualService |
|
How would that be possible in the case where we're updating load balancers? Could we somehow change the backing LB for a Gateway? We're thinking of implementing canary gateway upgrades. |
|
@keithmattix @howardjohn shouldn't there be a way of decoupling Gateways and VirtualServices? Because it does feel like Gateways are more at the platform management level and VirutalServices at the app management level. We could add admission control rules to watch for the selectors too. |
|
@tvenegas10 you're 100% correct about the difference in roles here, but that's why we're pushing users who need that separation to Gateway API: https://gateway-api-inference-extension.sigs.k8s.io/. |
|
@keithmattix I would gladly migrate to Gateway API if that would solve this problem for us, but my understanding is that this specific use case is not supported since kubernetes-sigs/gateway-api#594. Please correct me if I am wrong! |
|
Ah I see that the explicit binding from HTTPRoute to Gateways is an issue as well (which makes sense; I read through the response too quickly). I would recommend commenting on that Gateway API issue and asking for it to be reopened as that would be the clearest way to get this sort of functionality into Istio |
Add Label Selector Support for VirtualService Gateway Selection
Overview
This PR introduces a new
gateway_selectorfield to the VirtualService API that enables selecting gateways using Kubernetes-style label selectors instead of explicit gateway names.Problem
Currently, VirtualServices require explicitly listing gateway names, which creates operational challenges when updating or replacing gateways across hundreds of VirtualServices.
Related Issue
Fixes: #58426
Solution
Add a new
gateway_selectorfield with Kubernetes-style label selectors.API Changes
New Message
Updated VirtualService
Examples
Select by labels
Mix names and selectors
Benefits
Backward Compatibility
gatewaysfield unchangedgateway_selectortakes precedence if both specifiedFiles Changed
Related Work
Requires implementation PR in istio/istio repository.