25 Commits

Author SHA1 Message Date
Aleksei Sviridkin
5a55b09f48
feat(annotations): add custom annotation prefix support for split horizon DNS (#5889)
* feat(annotations): add custom annotation prefix support for split horizon DNS

Add --annotation-prefix flag to allow customizing the annotation prefix
used by external-dns. This enables split horizon DNS scenarios where
multiple instances process different sets of annotations from the same
Kubernetes resources.

Changes:
- Add AnnotationPrefix field to Config with validation
- Convert annotation constants to variables that can be reconfigured
- Add SetAnnotationPrefix() function to rebuild annotation keys
- Integrate annotation prefix setting in controller startup
- Update Helm chart with annotationPrefix value
- Add comprehensive split horizon DNS documentation
- Update FAQ with annotation prefix examples

This maintains full backward compatibility - the default prefix remains
"external-dns.alpha.kubernetes.io/".

Co-Authored-By: Claude <noreply@anthropic.com>

* docs(advanced): fix markdown formatting in split-horizon guide

Add blank lines before code blocks to improve markdown rendering
and comply with markdownlint rules.

Co-Authored-By: Claude <noreply@anthropic.com>

* docs(advanced): fix markdown formatting in split-horizon guide

Co-Authored-By: Claude <noreply@anthropic.com>

* docs(charts): regenerate Helm chart documentation

Co-Authored-By: Claude <noreply@anthropic.com>

* test: add AnnotationPrefix field to test configs

Add missing AnnotationPrefix field to minimalConfig and overriddenConfig
test configurations to match the new default value set in NewConfig().

Co-Authored-By: Claude <noreply@anthropic.com>

* test(charts): update error pattern in json-schema test

Update expected error message pattern to match current Helm validation
output format.

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor(annotations): remove init() for explicit initialization

- Remove init() function from annotations package
- Add explicit SetAnnotationPrefix() call in controller/execute.go
- Remove annotation key aliases from source/source.go
- Replace all alias usages with annotations.* references (348 changes in 28 files)
- Add TestMain to existing test files (service_test.go, cloudflare_test.go)

This change makes annotation initialization explicit and predictable,
avoiding hidden global state initialization at import time.

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: update changelog and mkdocs to include annotationPrefix and split horizon DNS

Signed-off-by: Aleksei Sviridkin <f@lex.la>

* docs(split-horizon): fix linting

Signed-off-by: Aleksei Sviridkin <f@lex.la>

* refactor(annotations): replace hardcoded annotation prefix with constant

Replace all hardcoded "external-dns.alpha.kubernetes.io/" strings
with annotations.DefaultAnnotationPrefix constant to establish
a single source of truth.

Changes:
- Add DefaultAnnotationPrefix constant in source/annotations/annotations.go
- Replace hardcoded string in controller/execute.go with constant reference
- Replace hardcoded strings in pkg/apis/externaldns/types.go (2 occurrences)
- Add helm unit tests for annotationPrefix value

This eliminates string duplication and makes future changes easier.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Signed-off-by: Aleksei Sviridkin <f@lex.la>
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-08 03:56:52 -08:00
Valerian Roche
111df9f1fb
feat(source): use transformers in pod informers to reduce memory footprint (#5596)
* feat: use transformers in pod informers to reduce memory footprint

Add a transformer to the pods informer of the pod and service sources.

Refs: #5595

Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>

* Do not use transformer when fqdnTemplate is set

* Update source/pod_test.go

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>

---------

Signed-off-by: Valerian Roche <valerian.roche@datadoghq.com>
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2025-08-09 01:51:44 -07:00
Ivan Ka
6e1651a21c
feat(source): support --event flags with sources pod and node (#5642)
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-07-15 23:50:23 -07:00
Ivan Ka
4fd5596601
feat(source/pods): support for annotation and label filter (#5583)
* feat(source): pods added support for annotation filter and label selectors

* feat(source/pods): support for annotation and label filter

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-07-03 09:15:34 -07:00
Ivan Ka
17fa4b4e7a
feat(source): support ttl annotation on pod (#5527)
* feat(source/pod): add support ttl annotation

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* feat(source/pod): add support ttl annotation

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-06-19 21:50:51 -07:00
Ivan Ka
7792986483
feat(source/pod): add support for fqdn templating (#5512)
* feat(source/pod): add support for fqdn templating

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* feat(source/pod): add support for fqdn templating

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* feat(source/pod): add support for fqdn templating

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* feat(source/pod): add support for fqdn templating

Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>

* feat(source/pod): add support for fqdn templating

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* feat(source/pod): add support for fqdn templating

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* feat(source/pod): add support for fqdn templating

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>

* feat(source/pod): add support for fqdn templating

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2025-06-13 06:14:58 -07:00
vflaux
0b3e40579b
chore(code-quality): reduce cyclomatic complexity of podSource.Endpoints() (#5470)
* fix(source): handle get node errors

fix nil pointer dereferences in podSource.Endpoints (#5405)

* chore: reduce podSource.Endpoints() cyclop
2025-06-06 08:24:39 -07:00
ivan katliarchuk
2b7d236734
chore(source): move cache informer to dedicated folder
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-05-25 13:47:16 +01:00
ivan katliarchuk
fe83c0d2d0
chore(source): code cleanup 2025-05-12 14:21:28 +01:00
ivan katliarchuk
e22c451744
feat(code-quality): source/pod improve code coverage
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-05-10 13:23:16 +01:00
ivan katliarchuk
9f427e5622
chore(source): code cleanup 2025-04-16 13:50:04 +01:00
Michel Loiseleur
3835c62bb6 chore(ci): update linter to v2.0.2 2025-04-02 08:53:54 +02:00
foyerunix
bf8c4c0ba6 Allow to register all pods and their associated PTR record
Add two new options:
- --ignore-non-host-network-pods
- --pod-source-domain

Combined toghether, they can be used to register the IPs
of all pods with their associated PTR record.

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2025-01-14 07:23:38 +00:00
John Gardiner Myers
4a32aaec01 Implement target annotation for more sources 2023-09-27 23:16:14 -07:00
John Gardiner Myers
4417ad4894 Move EndpointKey to endpoints package 2023-06-18 16:47:37 -07:00
Antoine Bardoux
b17506cfa3 Remove unnecessary trailing newline 2023-05-16 15:43:28 +02:00
Antoine Bardoux
f385139abc Allow multiple hostnames in internal annotation for pods 2023-05-12 12:16:08 +02:00
John Gardiner Myers
4745ddbb0e Address review comment 2023-05-09 19:42:56 -07:00
John Gardiner Myers
683663e9c2 IPv6 internal node IPs are usable externally 2023-05-07 12:00:28 -07:00
Andy Bursavich
74ffff6c26 gofumpt 2022-09-20 20:48:57 -07:00
Andrey Lebedev
4f41229820 Pass stop channel to informer factory instances 2022-01-22 21:31:29 +01:00
Andy Bursavich
60c649bf5c source: dedupe wait for cache sync
wait
2021-07-28 13:37:17 -07:00
Ole Markus With
ba30810641 Use kops dns controller instead of just dns controller where it makes sense
Co-authored-by: Nick Jüttner <nick@juni.io>
2021-06-24 08:31:42 +02:00
Ole Markus With
73469a0852 Support dns-controller compat mode for pod source 2021-06-23 09:06:38 +02:00
Ole Markus With
5a46584221 Add pod source
Pod source is a key feature of kOps' DNS Controller.
Among other things, i is used for etcd and API discovery.
2021-03-31 15:48:41 +02:00