Skip to content

docs(proposal): generic target-from resource dereference#6536

Open
mloiseleur wants to merge 3 commits into
kubernetes-sigs:masterfrom
mloiseleur:docs/target-from
Open

docs(proposal): generic target-from resource dereference#6536
mloiseleur wants to merge 3 commits into
kubernetes-sigs:masterfrom
mloiseleur:docs/target-from

Conversation

@mloiseleur

@mloiseleur mloiseleur commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

What does it do ?

Adds proposal 007: a generic external-dns.kubernetes.io/target-from annotation resolving a record's target from a field on another resource (dynamic client + RESTMapper, no vendor CRDs in sources).

Replaces per-product source-to-CRD coupling.

Motivation

Recurring, repeatedly-held/closed requests to couple sources to product CRDs: #6438 (Istio→Gateway API), #6190 / #6166 (→AWS Global Accelerator), #6457, #4687.

Formalizes the generic annotation @ivankatliarchuk sketched in #6190.

More

Proposal 007. Generic external-dns.alpha.kubernetes.io/target-from
annotation to source a record target from a field on another resource,
replacing per-product source-to-CRD coupling (istio ingress, proposed
gateway/global-accelerator).
@kubernetes-prow

Copy link
Copy Markdown

[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 vflaux 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

@kubernetes-prow
kubernetes-prow Bot requested review from u-kai and vflaux July 4, 2026 11:43
@kubernetes-prow kubernetes-prow Bot added docs size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 4, 2026
@coveralls

coveralls commented Jul 4, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 28705265521

Coverage remained the same at 83.384%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 21870
Covered Lines: 18236
Line Coverage: 83.38%
Coverage Strength: 1424.05 hits per line

💛 - Coveralls

@ivankatliarchuk

Copy link
Copy Markdown
Member

I actually have branch with changes on my machine. Was experimenting with best possible options

@u-kai u-kai left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this proposal!

One concern: cross-namespace target-from references could introduce unexpected vulnerabilities. Worth considering something like Gateway API's ReferenceGrant for this?

@ivankatliarchuk

Copy link
Copy Markdown
Member

On ReferenceGrant specifically: I'm not sure it fits the model external-dns operates under. Today, the referencer sets an annotation pointing at another resource - the referenced resource's owner has no say, for target, ingress, or any other lookup. That's not particular to this proposal; it's how the whole annotation-driven model already works. So the question isn't really "does this one feature need a grant mechanism" but "does external-dns's model need one at all" - given RBAC already governs what the controller can read.

There's already a Kubernetes-native mechanism for this: RBAC. Operators grant external-dns's ServiceAccount access to exactly the namespaces and resources they want it to read - that's the existing "who can point at what" boundary, and it already applies to every source in this codebase today.

On a possible --target-from-allowed-resources flag, I see it cutting both ways:

  • Against: it works against least privilege. RBAC should be the single source of truth for what external-dns can access - not "the ServiceAccount has broad access, but the code additionally restricts itself to X and Y." Two places to reason about access is worse than one.
  • For: from an implementation standpoint, an allowlist lets us load only the specific resources we care about into the cache, which is meaningfully more efficient than watching everything.

So if we do add something like new flag or CRD (ReferenceGrant), I'd frame it purely as a caching/efficiency knob, not a security boundary - RBAC already owns that job, and not clear why we should be introducing another abstraction.

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. docs size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants