42 Commits

Author SHA1 Message Date
Ivan Ka
eb40149b99
test: improve code coverage (#6321)
* test: improve code coverage

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

* test: improve code coverage

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2026-03-29 23:46:12 +05:30
Ivan Ka
475cb2dd8b
feat(informers): reduce informer cache memory footprint via object transformers (#6240)
* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transfomers

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

* feat(informers): reduce informer cache memory footprint via object transfomers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

* feat(informers): reduce informer cache memory footprint via object transformers

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2026-03-21 20:26:13 +05:30
Ivan Ka
083b6e9a12
docs(sources): surface provider-specific annotations support in documentation (#6231)
* docs(sources): surface provider-specific annotations support it in source documentation

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

* docs(sources): surface provider-specific annotations support it in source documentation

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

* docs(sources): surface provider-specific annotations support it in source documentation

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

* docs(sources): surface provider-specific annotations support it in source documentation

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

* docs(sources): surface provider-specific annotations support it in source documentation

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

* docs(sources): surface provider-specific annotations support it in source documentation

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

* docs(sources): surface provider-specific annotations support in documentation

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

* docs(sources): surface provider-specific annotations support in documentation

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

* docs(sources): surface provider-specific annotations support in documentation

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

* docs(sources): surface provider-specific annotations support in documentation

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2026-03-19 19:04:31 +05:30
Ivan Ka
7c909a015c
chore(source): standardize source fields with sources.Config (#6073)
* chore(source): standardize sources with config

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

* chore(source): standardize sources with config

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

* chore(source): standardize sources with config

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

* chore(source): standardize sources with config

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

* chore(source): standardize sources with config

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

* chore(source): standardize sources with config

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

* chore(source): standardize sources with config

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

* chore(source): standardize sources with config

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

* chore(source): standardize sources with config

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

* chore(source): standardize sources with config

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

* chore(source): standardize sources with config

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2026-03-16 14:41:40 +05:30
Ivan Ka
aa2a488b53
refactore(source): move EndpointsForHostname to endpoints package (#6248)
* refactore(source): move EndpointsForHostname to endpoint package

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

* refactore(source): move EndpointsForHostname to endpoint package

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

* refactore(source): move EndpointsForHostname to endpoint package

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2026-03-12 12:57:36 +05:30
Ivan Ka
ef69679e38
chore(source): standardize sources with merge endpionts and deduplicate targets (#6174)
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2026-02-23 00:10:58 +05:30
Ivan Ka
a929ad6cc6
chore(linter): enable unparam (#6160)
* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

* chore(linter): enable unparam

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>
2026-02-20 15:15:39 +05:30
Ivan Ka
b304dfe37d
chore(linter): unused params and functions linter (#6142)
* chore(linter): enable unused

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

* chore(linter): enable unusedparam

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>
2026-01-31 23:20:24 +05:30
Ivan Ka
89eec8151b
chore(source): standardize sources (#6089)
* chore(source): standardize sources

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

* chore(source): sources to standartise with IsControllerMismatch

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

* chore(source): sources to standartise with IsControllerMismatch

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

* chore(source): sources to standartise with IsControllerMismatch

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

* chore(source): sources to standartise with IsControllerMismatch

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

* chore(source): sources to standartise with IsControllerMismatch

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

* chore(source): sources to standartise

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

* chore(source): sources to standartise

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

* chore(source): sources to standartise

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

* chore(source): sources to standartise

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

* chore(source): sources to standartise

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

* chore(source): sources to standartise

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>
2026-01-21 16:49:26 +05:30
Ivan Ka
a174cc03d4
docs(source): autogenerate docs for events (#6119)
* docs(source): autogenerate docs for events

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

* docs(source): autogenerate docs for events

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

* docs(source): autogenerate docs for events

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

* docs(source): autogenerate docs for events

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

* docs(source): autogenerate docs for events

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

* docs(source): autogenerate docs for events

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

* docs(source): autogenerate docs for events

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

* docs(source): autogenerate docs for events

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2026-01-21 16:37:28 +05:30
Ivan Ka
97af77f5af
docs(source): autogenerate docs for sources with go-doc like style (#6075)
* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

* docs(source): autogenerate docs from sources attached to annotations

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: vflaux <38909103+vflaux@users.noreply.github.com>
2026-01-07 02:59:38 +05:30
Ivan Ka
a4035f12a3
refactor(annotation): rationalize filtering (#6065)
* chore(annotation): eliminate annotation filtering duplication

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

* chore(annotation): eliminate annotation filtering duplication

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

* chore(annotation): eliminate annotation filtering duplication

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

* chore(annotation): eliminate annotation filtering duplication

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

* chore(annotation): eliminate annotation filtering duplication

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

* chore(annotation): eliminate annotation filtering duplication

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

* chore(annotation): eliminate annotation filtering duplication

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

* chore(annotation): eliminate annotation filtering duplication

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

* chore(annotation): eliminate annotation filtering duplication

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-12-30 20:16:41 +05:30
Ivan Ka
2bdb8df7e2
refactor(source): handle context in similar way (#6049)
* chore(source): sources to handle context in similar way

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

* chore(source): sources to handle context in similar way

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

* chore(source): sources to handle context in similar way

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-12-30 16:28:34 +05:30
Ivan Ka
a23f2d5a9a
chore(lint): configure modernize linter (#6035)
* chore(lint): configure modernize linter

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

* chore(lint): configure modernize linter

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

* chore(lint): modernize linter

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

* chore(lint): configure modernize linter

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-12-27 22:04:33 +05:30
Till Hoffmann
222b95fdca
fix(docs): Fixing typos in docs and comments (#5995) 2025-12-05 11:16:57 -08:00
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
Ivan Ka
1b77c19d3c
chore(codebase): reuse functions (#5607)
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-07-06 01:17:25 -07:00
Ivan Ka
6e2fc4aa31
chore(codebase): enable linter nonamedreturns (#5594)
* chore(codebase): enable linter nonamedreturns

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

* chore(codebase): enable linter nonamedreturns

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-07-01 22:13:25 -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
9f8f30882b
chore(source): code cleanup
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-05-09 08:21:31 +01:00
Ivan Ka
ba64e8bb01
chore(deps): code cleanup, do not use pkg/errors (#5335)
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
2025-04-29 01:17:57 -07:00
ivan katliarchuk
9f427e5622
chore(source): code cleanup 2025-04-16 13:50:04 +01:00
Kyle
38178940a3
feat: add annotation and label filters to Ambassador Host Source (#2633)
* Add annotation filter to Ambassador Host Source

This change makes the Ambassador Host source respect the External-DNS annotationFilter allowing for an Ambassador Host resource to specify what External-DNS deployment to use when there are multiple External-DNS deployments within the same cluster. Before this change if you had two External-DNS deployments within the cluster and used the Ambassador Host source the first External-DNS to process the resource will create the record and not the one that was specified in the filter annotation.

I added the `filterByAnnotations` function so that it matched the same way the other sources have implemented annotation filtering. I didn't add the controller check only because I wanted to keep this change to implementing the annotationFilter.

Example: Create two External-DNS deployments 1 public and 1 private and set the Ambassador Host to use the public External-DNS using the annotation filter.

```
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: external-dns-private
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: external-dns-private
  template:
    metadata:
      labels:
        app: external-dns-private
      annotations:
        iam.amazonaws.com/role: {ARN} # AWS ARN role
    spec:
      serviceAccountName: external-dns
      containers:
      - name: external-dns
        image: k8s.gcr.io/external-dns/external-dns:latest
        args:
        - --source=ambassador-host
        - --domain-filter=example.net # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
        - --provider=aws
        - --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
        - --aws-zone-type=private # only look at public hosted zones (valid values are public, private or no value for both)
        - --registry=txt
        - --txt-owner-id= {Hosted Zone ID} # Insert Route53 Hosted Zone ID here
        - --annotation-filter=kubernetes.io/ingress.class in (private)
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: external-dns-public
spec:
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: external-dns-public
  template:
    metadata:
      labels:
        app: external-dns-public
      annotations:
        iam.amazonaws.com/role: {ARN} # AWS ARN role
    spec:
      serviceAccountName: external-dns
      containers:
      - name: external-dns
        image: k8s.gcr.io/external-dns/external-dns:latest
        args:
        - --source=ambassador-host
        - --domain-filter=example.net # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
        - --provider=aws
        - --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
        - --aws-zone-type= # only look at public hosted zones (valid values are public, private or no value for both)
        - --registry=txt
        - --txt-owner-id= {Hosted Zone ID} # Insert Route53 Hosted Zone ID here
        - --annotation-filter=kubernetes.io/ingress.class in (public)
---
apiVersion: getambassador.io/v3alpha1
  kind: Host
  metadata:
    name: your-hostname
    annotations:
      external-dns.ambassador-service: emissary-ingress/emissary
      kubernetes.io/ingress.class: public
  spec:
		acmeProvider:
      authority: none
		hostname: your-hostname.example.com
```

Fixes kubernetes-sigs/external-dns#2632

* Add Label filltering for Ambassador Host source

Currently the `--label-filter` flag can only be used to filter CRDs, Ingress, Service and Openshift Route objects which match the label selector passed through that flag. This change extends the functionality to the Ambassador Host type object.

When the flag is not specified the default value is `labels.Everything()` which is an empty string, the same as before. An annotation based filter is inefficient because the filtering has to be done in the controller instead of the API server like with label filtering. The Annotation based filtering has been left in for legacy reasons so the Ambassador Host source can be used inconjunction with the other sources that don't yet support label filltering.

It is possible to use label based filltering with annotation based filltering so you can initially filter by label then filter the returned hosts by annotation. This is not recomended

* Update Ambassador Host source docs

Add that the Ambassador Host source now supports both annotation and label filltering.
2024-08-28 18:02:57 +01:00
Michel Loiseleur
971c91d2cf review with Raffo 2024-05-16 10:51:13 +02:00
Michel Loiseleur
9597d257a7 fix: linter on unused parameter 2024-05-16 08:44:06 +02:00
Frederic Mereu
6cec5dd7df
feat(ambassador): add support for provider specific annotations 2024-02-12 11:40:28 +01:00
Frederic Mereu
fecd4273af
fix(ambassador): don't resolve LB hostname
Signed-off-by: Frederic Mereu <frederic.mereu@gaming1.com>
2023-12-05 09:56:32 +01:00
Kubernetes Prow Robot
d8f408b8a5
Merge pull request #3734 from fad3t/ambassador-external-ip
feat: add support for external IP in ambassador host source
2023-10-27 13:22:02 +02:00
John Gardiner Myers
17e9637f11
Refactor getTTLFromAnnotations() to not return error (#3939)
* Refactor getTTLFromAnnotations() to not return error

* Improve log messages
2023-10-02 03:56:45 -07:00
John Gardiner Myers
4a32aaec01 Implement target annotation for more sources 2023-09-27 23:16:14 -07:00
John Gardiner Myers
50e456997f Create the "resource" label for Ambassador Host 2023-08-29 11:36:30 -07:00
John Gardiner Myers
39955e556e Refactor setting the "resource" label into endpointsForHostname 2023-08-29 11:36:27 -07:00
Frederic Mereu
73862a802b
chore: reuse existing extractLoadBalancerTargets function 2023-08-12 13:49:17 +02:00
Frederic Mereu
f9099b8bfc
feat: add support for external IP in ambassador host source 2023-06-26 13:40:41 +02:00
Andy Bursavich
74ffff6c26 gofumpt 2022-09-20 20:48:57 -07:00
Ole Markus With
a1a9091cdf Ignore ambassador-hosts with invalid annotations
If e.g the ambassador service annotation points to an nonexisting service, external-dns will not update any DNS records. This PR makes external-dns ignore the host and carry on instead.
2022-09-07 19:38:36 +02:00
Andrey Lebedev
4f41229820 Pass stop channel to informer factory instances 2022-01-22 21:31:29 +01:00
Raffaele Di Fazio
d82bee2b53 Merge branch 'master' into raffo/bump-modules
Signed-off-by: Raffaele Di Fazio <raffo@github.com>
2021-08-12 16:28:30 +02:00
Raffaele Di Fazio
376d4653d8 remove kubernetes dependency
Signed-off-by: GitHub <noreply@github.com>
2021-08-10 13:48:11 +00:00
Andy Bursavich
60c649bf5c source: dedupe wait for cache sync
wait
2021-07-28 13:37:17 -07:00
Alvaro Saurin
6eeef96b14 Support Ambassador Host resources as sources
Ambassador can be configured with `Host` resources (based on the
`Host` CRD) for defining the external DNS host name.

This code adds a new source, `ambassador-host`, that looks for the
`ambassador/ambassador` Service and and uses the `hostname` from the
`Host` resource.

Signed-off-by: Alvaro Saurin <alvaro.saurin@gmail.com>
Signed-off-by: Flynn <flynn@datawire.io>
2021-01-27 12:47:10 -05:00