RFC: Add label selector support to exportTo field#3636
RFC: Add label selector support to exportTo field#3636hbhasker wants to merge 4 commits intoistio:masterfrom
Conversation
Add label selector support to export_to field for ServiceEntry, VirtualService, and DestinationRule. This allows resources to be dynamically exported to namespaces matching label selectors without knowing namespace names in advance. Related to istio/istio#50661
…backward compatibility - Add LabelSelector to type/v1beta1/selector.proto for networking resources - Keep LabelSelector in mesh/v1alpha1/config.proto for MeshConfig fields - This maintains backward compatibility with existing code using meshconfig.LabelSelector - New networking resources (VirtualService, DestinationRule, ServiceEntry) use istio.type.v1beta1.LabelSelector
|
😊 Welcome @hbhasker! This is either your first contribution to the Istio api repo, or it's been You can learn more about the Istio working groups, Code of Conduct, and contribution guidelines Thanks for contributing! Courtesy of your friendly welcome wagon. |
|
|
Hi @hbhasker. Thanks for your PR. I'm waiting for a istio 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. DetailsInstructions 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. |
|
I don't think this is tenable to implement realistically
…On Wed, Jan 14, 2026, 12:24 PM Istio Automation ***@***.***> wrote:
*istio-testing* left a comment (istio/api#3636)
<#3636 (comment)>
Hi @hbhasker <https://github.com/hbhasker>. Thanks for your PR.
I'm waiting for a istio <https://github.com/orgs/istio/people> member to
verify that this patch is reasonable to test. If it is, they should reply
with /ok-to-test on its own line. Until that is done, I will not
automatically test new commits in this PR, but the usual testing commands
by org members will still work. Regular contributors should join the org
<https://github.com/orgs/istio/people> to skip this step.
Once the patch is verified, the new status will be reflected by the
ok-to-test label.
I understand the commands that are listed here
<https://go.k8s.io/bot-commands?repo=istio%2Fapi>.
Details
Instructions for interacting with me using PR comments are available here
<https://git.k8s.io/community/contributors/guide/pull-requests.md>. If
you have questions or suggestions related to my behavior, please file an
issue against the kubernetes-sigs/prow
<https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:>
repository.
—
Reply to this email directly, view it on GitHub
<#3636 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEYGXPZDNEQQNMUDKWIRD34G2QXHAVCNFSM6AAAAACRW27F2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTONJRGU3TIOBRGI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
- Revert config.pb.go to keep LabelSelector in mesh/v1alpha1 - Revert config_json.gen.go changes - Reorder export_to_selectors to be after workload_selector in destination_rule.proto - Reorder fields in service_entry.proto to match field number ordering 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
@howardjohn could you elaborate on why? btw sorry I explicitly marked this as draft for now because I didn't think it was ready for review. But since I have your attention :) |
- Keep LabelSelector and LabelSelectorRequirement documentation in mesh/v1alpha1 - Maintain local links to LabelSelector instead of external URLs - Keep number_of_entries at 84 This is consistent with reverting config.pb.go changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
ping @howardjohn , I have an WIP implementation(untested) for this but I would like to understand why you think its untenable before I spend more time on the implementation. |
|
+1 Can we give life to this PR ? This reduces a lot of overhead on platform teams. If this is technically difficult, how about regular expression ? say all namespaces starting with product. Or say all namespaces ending with internal |
Since both @howardjohn and @ramaraochavali believe that it's hard to implement. |
|
Its not just about 1 time PR complexity, its the long term. When we later
realize we missed some edge case and it bloats, when we realize we need to
implement it in some other places (ambient, etc), when we realize it
doesn't scale and causes unfixable performance issues.
A small PR showing it is "simple" would not make me in favor of this API.
…On Tue, Mar 17, 2026 at 3:48 AM zirain ***@***.***> wrote:
*zirain* left a comment (istio/api#3636)
<#3636 (comment)>
ping @howardjohn <https://github.com/howardjohn> , I have an WIP
implementation(untested) for this but I would like to understand why you
think its untenable before I spend more time on the implementation.
Since both @howardjohn <https://github.com/howardjohn> and @ramaraochavali
<https://github.com/ramaraochavali> believe that it's hard to implement.
can you kindly send out you draft PR to help us understand this FR better.
—
Reply to this email directly, view it on GitHub
<#3636 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEYGXL7KLCJL7ANK6K6MF34REUPHAVCNFSM6AAAAACRW27F2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DANZUGAZTQMZYGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
I'm also a -1 to this API; exportTo only exists because of sidecar scaling issues and lack of proper namespace tenancy semantics in the v1alpha3 networking APIs. I don't see a reason to extend usage of this pattern; we should instead be moving users over to Gateway API |
Summary
This PR adds label selector support to the
exportTofield for networking resources in the Istio API.Implements support for: istio/istio#50661
Changes
1. Add exportToSelectors field to networking resources
networking/v1alpha3/virtual_service.proto: Addedexport_to_selectorsfield (field number 7)networking/v1alpha3/destination_rule.proto: Addedexport_to_selectorsfield (field number 6)networking/v1alpha3/service_entry.proto: Addedexport_to_selectorsfield (field number 10)2. LabelSelector type definition
LabelSelectorandLabelSelectorRequirementmessages totype/v1beta1/selector.protoLabelSelectorinmesh/v1alpha1/config.protofor backward compatibilityistio.type.v1beta1.LabelSelectormesh.v1alpha1.LabelSelectorBackward Compatibility
This PR maintains backward compatibility:
LabelSelectorexists in bothmesh/v1alpha1andtype/v1beta1meshconfig.LabelSelectorcontinues to worktypev1beta1.LabelSelectorfor networking resourcesExample Usage
When both
exportToandexportToSelectorsare specified, the resource is exported to the union of all matched namespaces.Protobuf Field Numbers
Carefully chosen to avoid conflicts:
Related
🤖 Generated with Claude Code