feat(source)!: support multiple namespaces in --namespace - #6599
Draft
mloiseleur wants to merge 4 commits into
Draft
feat(source)!: support multiple namespaces in --namespace#6599mloiseleur wants to merge 4 commits into
mloiseleur wants to merge 4 commits into
Conversation
Turns --namespace into a repeatable, comma-separated flag and Config.Namespace into Namespaces []string. Sources still watch a single namespace; config validation rejects several values for those, and for the crd registry, instead of silently keeping the first one.
Decouples the CRD registry storage namespace from --namespace, which scopes the sources. Defaults to the namespace ExternalDNS runs in, read from POD_NAMESPACE, the pod service account or the kubeconfig context, instead of `default`. Replaces the validation error raised when --namespace held several values with the crd registry.
…ike sources Moves service, crd, ingress, ambassador-host, contour-httpproxy, f5-virtualserver, f5-transportserver, kong-tcpingress, openshift-route, traefik-proxy and unstructured onto the per-namespace informer factories, and lifts the --namespace validation for them. Cluster-scoped informers stay unique, and the crd source relies on the controller-runtime cache, which is namespace-scoped already.
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Coverage Report for CI Build 30672105678Coverage increased (+0.1%) to 81.818%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions338 previously-covered lines in 18 files lost coverage.
Coverage Stats
💛 - Coveralls |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do ?
Makes
--namespacerepeatable and comma-separated:One informer factory per namespace, so it works under namespace-scoped RBAC.
Supported:
service,crd,ingress,ambassador-host,contour-httpproxy,f5-transportserver,f5-virtualserver,kong-tcpingress,openshift-route,traefik-proxy,unstructured.Several namespaces with a source not yet migrated fails at startup, instead of silently watching the first:
Config.Namespace stringbecomesNamespaces []string. Compile-time break for out-of-tree consumers ofpkg/apis/externaldns. No config change for operators.Also adds
--crd-registry-namespace, decoupling the CRD registry storage namespace from--namespace. Defaults to the namespace ExternalDNS runs in instead ofdefault. That registry is unreleased, so no migration.Motivation
Fixes #3565. Scoped multi-tenant deployments currently need one ExternalDNS instance per namespace.
Supersedes #6387 by @AryanSharma9917, which added
--service-namespacefor the Service source only. Extending--namespaceavoids a namespace flag per source and covers every source at once.Follow-ups
istio-gateway,istio-virtualservice,podskipper-routegroup,gateway-*--gloo-namespaceand--gateway-namespaceserviceandcrdMore
serviceandcrd; the other 9 rely on their existing suitesValidation:
go test -race ./...golangci-lint run ./...make licensecheckmake generate-flags-documentation generate-sources-documentationFixes #3565
Supersedes #6387