Commit Graph

46 Commits

Author SHA1 Message Date
kaikai
a4522f0b76
chore(domainfilter): use pointer receivers for DomainFilter (#5546)
* refactor(domainfilter): use pointer receivers for DomainFilter

* refactor(domainfilter): complete pointer type consistency across providers
2025-06-21 00:38:53 -07:00
Ivan Ka
d63bfb324c
feat(controller)!: publish metrics for all supported endpoint types (#5516)
* feat(controller): add more metrics for all supported endpoint types

* feat(controller): add cardinality and labels for records metrics

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

* feat(controller): add cardinality and labels for records metrics

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

* feat(controller): add cardinality and labels for records metrics

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

* feat(controller): add cardinality and labels for records metrics

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

* feat(controller): add cardinality and labels for records metrics

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

* feat(controller): add cardinality and labels for records metrics

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

* feat(controller): add cardinality and labels for records metrics

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

* feat(controller): add cardinality and labels for records metrics

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

* fix rebase

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>
2025-06-13 02:40:58 -07:00
kaikai
662fb3652d
test(controller): increase timeout and refactor toggle registry test (#5518)
* test(controller): increase timeout and refactor toggle registry test

* Update controller/controller_test.go TestToggleRegistry deadline

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

---------

Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2025-06-13 00:39:03 -07:00
Andrew Hay
93d4d47bff
feat(metrics): consecutiveSoftErrors (#5502)
* feat(controller): add consecutive soft error metric and improve retry test

* docs: clean up metrics.md Go runtime metrics table, remove duplicates, ensure CI compliance

* style: gofmt

* style: gofmt
2025-06-06 09:52:39 -07:00
Ivan Ka
1e8e5e06c5
chore(docs): generate docs/monitoring/metrics.md file (#5117)
* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

* chore(docs): generate docs/monitoring/metrics.md file

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

---------

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2025-03-04 05:05:44 -08:00
Thibault Jamet
b2ff1619f5
Add Domain filter interface 2024-08-14 10:20:59 +02:00
Thibault Jamet
2007a49f1f
Improve MinEventInterval compliance with docs
**Description**

In the command line arguments, we see `min-event-sync-interval` as
"The minimum interval between two consecutive synchronizations triggered from kubernetes events"

In the code, it actually acts a different way.

It imposes a certain dealy between syncs.
While this is compliant with the "minimum delay between 2 consecutive
synchronizations", it has side-effects in case of large delays.

In particular, when trying to fine-tune external-dns to match the
provider rate-limits.

In this case, it may be interesting to restrict the rate of reconciling
actions happening by having a high `min-event-sync-interval`, while
keeping a low latency for initial events.

This would allow to maximise the bulk effect of high change rate while
keeping fast enough reaction for isolated changes.

**Checklist**

- [X] Unit tests updated
- [X] End user documentation updated
> End user documentation matches the updated behaviour with more
> accuracy
Change-Id: Ibcea707974a095a2d5861a3974b4c79e5a15b00e
2024-08-06 08:52:27 +02:00
Kubernetes Prow Robot
fa17f9d06c
Merge pull request #3639 from kubernetes-sigs/test/controller-run
test: controller run() and successfully shutdown
2024-05-03 12:53:43 -07:00
Sandor Szücs
2b50b14726
refactor: as suggested
fix: race as suggested

Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
2024-01-05 20:11:19 +01:00
John Gardiner Myers
43eea7fa9b Refactor Provider to require DomainFilter 2023-06-19 20:25:59 -07:00
Matias Charriere
e938f5a67f
remove tests from missing endpoint tests from controller
the entire logic of missing endpoints was removed from the controller
taking leverage on the planner

Signed-off-by: Matias Charriere <matias@giantswarm.io>
2023-06-15 11:50:04 +02:00
Sandor Szuecs
5af4ae0edc
test: controller run() should do somthing and successfully shutdown
Signed-off-by: Sandor Szuecs <sandor.szuecs@zalando.de>
2023-05-26 23:18:29 +02:00
John Gardiner Myers
2eed9cb6ba Add AAAA records metrics 2023-03-30 17:49:31 -07:00
Kubernetes Prow Robot
03e3d22298
Merge pull request #2609 from claudiumocanu/fix-reconcile-blocker
Do not reschedule, if already scheduled in the next MinInterval
2022-07-29 12:43:12 -07:00
Andrey Lebedev
0feb32de3c Handle the migration to the new TXT format: missing records to be created separately 2022-07-27 12:57:18 +02:00
claudiumocanu
58ae18439c ScheduleRunOnce if not already scheduled 2022-02-17 18:28:07 +02:00
Aditya Kolhar
19d9bc8ef9 Changes to add A records of source and registry as metrics
Changes to add A records of source and registry as metrics. The existing metrics -
external_dns_registry_endpoints_total & external_dns_source_endpoints_total gives a cumulative count of records all records (A, SRV, CNAME, TXT).

We have a metric - external_dns_controller_verified_records which gives the intersection of A records between source & regsitry. However, in order to determined how many records are yet to be synced to registry, we need count of total A records in registry & source.
2021-11-08 15:22:36 +05:30
Aditya Kolhar
39d5b39e18 Changes to add metric to external-dns.
1. external_dns_controller_verified_records - No of DNS A-records that exists both in source and registry - Gauge Metric
2021-10-27 13:51:31 +05:30
Dinar Valeev
c792d49c41
Fix controller tests
8d6f29b8a0 commit breaks
TestWhenNoFilterControllerConsidersAllComain and
TestWhenMultipleControllerConsidersAllFilteredComain tests,
lets fix them

Signed-off-by: Dinar Valeev <dinar.valeev@absa.africa>
2021-08-04 19:53:31 +02:00
Kubernetes Prow Robot
41ea66b7c6
Merge pull request #2078 from k0da/ns
Fix managed-record-types option
2021-08-04 08:35:24 -07:00
Dinar Valeev
8d6f29b8a0
Fix managed-record-types
Use config option instead of passing just A and CNAME

Signed-off-by: Dinar Valeev <dinar.valeev@absa.africa>
2021-05-13 17:03:13 +02:00
Thibault Jamet
17fb8813d0
Reduce AWS Route53 API calls
Currently, planning instructs to create all records even
those which does not match any zone.
Later, those records will be checked towards the existing
records and filtered whether they match or not a hosted zone.

This causes a problem, at least in the specific case of the Route53
implementation as it always calls the ApplyChanges method, which in its
turn always retrieves all records in all zones.

This causes high pressure on Route53 APIs, for non-necessary actions.

By being able to filter all unmanaged records from the plan, we can
prevent from calling ApplyChanges when nothing has to be done and hence
prevent an unnecessary listing of records.

By doing so, the rate of API calls to AWS Route53 is expected to be
reduced by 2
2021-04-25 18:10:36 +02:00
Thibault Jamet
43f9f564b3
Rename MinInterval to MinEventSyncInterval
Co-authored-by: Raffaele Di Fazio <raffo@github.com>
2021-03-24 11:27:18 +01:00
Thibault Jamet
72b4b4f411
Add the ability to configure k8s event rate limit
Currently, the minimum delay between 2 kubernetes events handling is
hard-coded to 5s.

This may cause higher synchronization rates and higher DNS provider API
calls when handling an important number of kubernetes events at once.

Give the opportunity to configure this delay so service owners can
define the acceptable thresholds on their side
2021-03-16 11:59:00 +01:00
windayski
262822e2f6 fix typos 2020-10-30 03:28:57 +00:00
Nick Jüttner
3388e3ddf1 improve linter quality for external-dns 2020-06-06 22:29:24 +02:00
Kubernetes Prow Robot
25d71ea45a
Merge pull request #1536 from sheerun/property-comparator
Allow for custom property comparators
2020-06-01 03:07:55 -07:00
Adam Stankiewicz
1806ade2c1 Fix scheduling of reconciliation 2020-05-19 17:26:12 +02:00
Adam Stankiewicz
f008e894df Allow for custom property comparators
Fixes issue #1463

Co-authored-by: Alastair Houghton <alastair@alastairs-place.net>
2020-05-12 16:27:46 +02:00
jlamillan
fed2f0f0dd
Add --events flag to use informers to automatically trigger sync loop on adds/updates/deletes for supported ingress and service sources. 2020-01-27 11:00:26 -08:00
Tariq Ibrahim
a5896c2326
remove context.TODO()s in external-dns 2020-01-15 13:59:20 -08:00
tariqibrahim
672b00d821 add ctx parameter to provider interface and aws API 2020-01-12 13:16:55 -08:00
Tariq Ibrahim
41ba7f1ff5
rename project root package to sigs.k8s.io 2020-01-06 08:08:35 -08:00
Nick Jüttner
f763d2a413 Move into kubernetes-sigs organization (#1245)
* Move into kubernetes-sigs organization

* Disable labeler action for forks
2019-11-01 17:10:19 +01:00
Michael Fraenkel
fab942f486 Cache the endpoints on the controller loop
The controller will retrieve all the endpoints at the beginning of its
loop. When changes need to be applied, the provider may need to query
the endpoints again. Allow the provider to skip the queries if its data was
cached.
2019-05-07 19:51:53 -04:00
John Chadwick
dd036e1b78 Fix test where record type is blank. 2018-06-01 09:08:17 -04:00
Till Klocke
5d54849699 Implementation of multiple targets based on PR #404 and #396 (#418)
* Endpoint.Target is now Endpoint.Targets. This is its own type representing mutliple targets for a single DNS name while adding some convenience for sorting and comparing

* Made everything compile and tests run through with the new Endpoint.Targets

* The ingress source can now properly handle multiple target ips per host

* Added custom conflict resolver, to better understand how conflict resolution has to work for me

* My custom conflict resolver behaves a bit different than the PerResource resolver, therefore I needed to modify the expected test result

Removed unnecessary FIXME

* The ingress source now creates CNAME endpoints with multiple targets to let the DNS provider decide how to handle multiple CNAME targets. This could be interesting for weighted targets etc.

* Adopted the expected results to the new way we create endpoints for CNAMEs

* Removed Add method from Targets since manipulating the slice through here is unnecessary complicated and doesn't deliver enough convenience

* Reverted ConflictResolver to the original one. There is some discussing to do what the best way is to handle conflicts

* Added missing documenting comment to IsLess of Targets

* Added documenting comments to Targets,Targets.Same and NewTargets to clarify their intention and usage

* Service source now also generates endpoints with multiple targets

* Service and Ingress source now sort all Targets for every Endpoint to make order of Targets predictable

* Endpoints generated by the Google Cloud DNS provider now also have sorted Targets to make order of Targets predictable

* Modified provider dyn to be able to compile with multi target changes

* Fixed small nitpicks, so my code is acceptable

* Fixed merge method after updating to new Targets. Replacing '!=' with .Same of course needs a boolean negation

* Tests for dyn provider now also use the new Targets instead of Target

* Simplified extractServiceIps as implied by linki to make it more readable

* ref: change service ClusterIP retrieval again

* Added entry to CHANGELOG.md describing the new features contained in this PR
2018-02-21 18:11:45 +01:00
Martin Linkhorst
406afacbf7 experiment: use testify in test code (#186)
* ref(source): use testify with mocks in test code

* fix: re-introduce NewMockSource for convenience

* fix: avoid circular dependency

* ref: increase usage of testify

* chore: vendor testify as a dependency

* fix(*): cleanup testify expectations
2017-05-31 10:24:11 +02:00
Martin Linkhorst
707bdc4d95 ref(*): remove superflous zone parameter (#212) 2017-05-22 15:38:27 +02:00
Martin Linkhorst
644206c952 allow plans to be parameterized via policies (#127)
* feat(plan): allow plans to be parameterized via policies

* fix(controller): set a policy in the controller tests

* chore: allow go tip to fail

* chore: update changelog to include policies

* fix(plan): store a pointer to changes

* fix(controller): don't get address of a pointer
2017-04-12 12:49:11 +02:00
Yerken
9a44453d59 define registry interface (#120)
* define registry interface

* init in-memory registry

* remove ununsed variable, added comments

* add inmemory registry tests

* introduce DNSRecord struct

* use noop registry

* remove zone from registry fields

* replace provider with registry in controller

* move noop registry interface check to test

* remove ownerid from noop registry

* fix: remove dangling empty line

* return provider records directly with noop

* adjust according to pr review

* fix noop tests
2017-04-07 16:00:24 +02:00
Yerken
f9402d7ed1 use pointer to endpoint via NewEndpoint initializer (#125)
* use pointer to endpoint via NewEndpoint initializer

* return nil if record does not exist in plan

* add test for NewEndpoint
2017-04-04 16:41:49 +02:00
Martin Linkhorst
318c6e532c ref(*): rename DNSProvider to just Provider (#101) 2017-03-17 14:35:10 +01:00
Martin Linkhorst
cf9c5e39ed feat(source): promote MockSource to source package (#78) 2017-03-13 14:17:55 +01:00
Martin Linkhorst
fb853808b8 feat(controller): make mock implementations more flexible by taking slices (#51) 2017-03-02 13:19:13 +01:00
Martin Linkhorst
99371a1e83 implementation of basic control loop (#40)
* feat(google): add ability to apply changes generated from a plan

* feat(controller): first implementation of controller

* feat: allow to configure in-cluster and kubeconfig

* fix(controller): call RunOnce at the right time and in a loop

* feat(google): add dryRun attribute to Google DNS provider

* fix: use hosted zone id instead of DNS name

* fix(google): stupidly filter by A records for now

* feat: allow specifying the google project and zone

* feat: provide a dry-run flag which defaults to false

* chore: vendor new dependencies

* fix(config): fix failing tests for config object

* ref(controller): return plain value of ApplyChanges

* ref: simplify how to get a valid kubernetes client
2017-03-01 16:17:47 +01:00