Skip to content

feat(service): add multi-namespace support for Service source#6387

Open
AryanSharma9917 wants to merge 2 commits into
kubernetes-sigs:masterfrom
AryanSharma9917:ns-service
Open

feat(service): add multi-namespace support for Service source#6387
AryanSharma9917 wants to merge 2 commits into
kubernetes-sigs:masterfrom
AryanSharma9917:ns-service

Conversation

@AryanSharma9917
Copy link
Copy Markdown

What this PR does

Adds multi-namespace support for the Service source by introducing repeatable --namespaces and label-based --namespace-label-selector filtering.

Why

This enables scoped multi-tenant deployments without requiring a separate external-dns instance per namespace.

Highlights

  • Adds --namespaces and --namespace-label-selector configuration
  • Wires new config fields through source config/store
  • Updates service source informer handling for multi-namespace behavior
  • Adds validation and test updates
  • Updates docs for new flags and usage

Fixes #3565

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ivankatliarchuk for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 22, 2026
@k8s-ci-robot k8s-ci-robot requested review from szuecs and vflaux April 22, 2026 17:13
@k8s-ci-robot k8s-ci-robot added apis Issues or PRs related to API change docs source labels Apr 22, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @AryanSharma9917!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 22, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @AryanSharma9917. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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 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.

Details

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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 22, 2026
Add repeatable --service-namespace flag and wire it through source config.\nImplement multi-namespace informer handling in service source and add tests.\nRegenerate docs and keep full test suite green.\n\nRefs kubernetes-sigs#3565

Signed-off-by: aryansharma9917 <sharmaaryan9837@gmail.com>
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 3, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

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.

@mloiseleur
Copy link
Copy Markdown
Collaborator

mloiseleur commented May 8, 2026

Instead of going down this path of having multiple namespaces array options per source, maybe we can consider extending current namespace option to allow multi namespace. It would simplify this PR, cover more use cases and won't require any additional flags.

We may even in a follow up PR deprecate and after remove gloo & gateway specific namespace options.

@AryanSharma9917 Wdyt ?

cc @Raffo @szuecs @vflaux

@AryanSharma9917
Copy link
Copy Markdown
Author

Instead of going down this path of having multiple namespaces array options per source, maybe we can consider extending current namespace option to allow multi namespace would simplify this PR, cover more use cases and won't require any additional flags.

We may even in a follow up PR deprecate and after remove gloo & gateway specific namespace options.

@AryanSharma9917 Wdyt ?

cc @Raffo @szuecs @vflaux

Hi @mloiseleur,

I think that would be a good approach, though I have a few questions before I move forward. Do you prefer a specific format like a comma separated list or an array? Also, should I start deprecating the Gloo and Gateway-specific options in this PR, or wait for the follow-up?

Signed-off-by: aryansharma9917 <sharmaaryan9837@gmail.com>
@mloiseleur
Copy link
Copy Markdown
Collaborator

mloiseleur commented May 11, 2026

Do you prefer a specific format like a comma separated list or an array?

Comma-separated list.

should I start deprecating the Gloo and Gateway-specific options in this PR, or wait for the follow-up?

Deprecation in a dedicated PR, if that's ok for you ?

@AryanSharma9917
Copy link
Copy Markdown
Author

Do you prefer a specific format like a comma separated list or an array?
Comma-separated list.

should I start deprecating the Gloo and Gateway-specific options in this PR, or wait for the follow-up?

Deprecation in a dedicated PR, if that's ok for you ?

@mloiseleur Thanks for confirming. That works for me.

I will keep this PR focused on multi namespace support using a comma separated list and open a separate PR for deprecating the Gloo and Gateway specific namespace options.

Please let me know if my understanding is correct or if I misunderstood anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apis Issues or PRs related to API change cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. docs needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support multiple namespaces for Service sources

3 participants