Commit Graph

119 Commits

Author SHA1 Message Date
John Gardiner Myers
beb893df7d Address review comment 2023-06-12 21:28:18 -07:00
John Gardiner Myers
55bbb29f55 Route53 update configuration of target health checks 2023-06-09 17:11:28 -07:00
John Gardiner Myers
4b15f20e76 Simplify GetProviderSpecificProperty 2023-06-09 07:33:41 -07:00
John Gardiner Myers
d1fb3423c4 Simplify DomainFilterInterface 2023-06-05 13:14:23 -07:00
John Gardiner Myers
7efecc711f Simplify TargetFilterInterface 2023-06-05 12:54:44 -07:00
Kubernetes Prow Robot
3346b4e53c
Merge pull request #3519 from Sewci0/feature/mx-support
Add support for MX records in Azure, GCP and AWS
2023-05-15 12:13:07 -07:00
Viacheslav Sychov
2554f9f879 #1828: Support encrypted DNS txt records
Signed-off-by: Viacheslav Sychov <viacheslav.sychov@gmail.com>
2023-04-28 20:29:54 +02:00
John Gardiner Myers
6b20ba301c Remove unnecessary unit test changes 2023-03-30 17:49:31 -07:00
John Gardiner Myers
de1db3f03d Unit test fixes 2023-03-30 17:49:31 -07:00
Skyler Mäntysaari
6f42a8a2da Initial IPv6 support 2023-03-30 17:49:28 -07:00
John Gardiner Myers
94d09b37dc Separate plan by record type 2023-03-30 17:47:59 -07:00
Seweryn Chlewicki
205e8c0334
Add support for MX records in Azure, GCP and AWS 2023-03-30 20:32:32 +01:00
Alfred Krohmer
7dd84a589d Route53: retry single changes in a batch if the batch fails
If a single change fails during the retry, it will be added to a queue.
In the next iteration, changes from this queue will be submitted after
all other changes.

When submitting single changes, they are always submitted as batches of
changes with the same DNS name and ownership relation to avoid
inconsistency between the record created and the TXT records.
2023-01-16 16:03:16 +01:00
Kubernetes Prow Robot
5b73225407
Merge pull request #2850 from orirawlings/exclusionOnlyDomainFilterFix
Restore support for exclusion-only domain filters for AWS provider
2022-11-05 03:12:14 -07:00
Kubernetes Prow Robot
644b880897
Merge pull request #3017 from olemarkus/ignore-invalid-endpoint
Don't create endpoint if attempting to create one with invalid dns name
2022-10-06 12:37:53 -07:00
Andy Bursavich
74ffff6c26 gofumpt 2022-09-20 20:48:57 -07:00
Ole Markus With
7dbf503fe1 Don't create endpoint if attempting to create one with invalid dns name 2022-09-10 12:31:13 +02:00
Kubernetes Prow Robot
e2b86a1146
Merge pull request #2693 from tobikris/add-target-net-filter
add target filters based on network
2022-08-02 01:38:15 -07:00
Ori Rawlings
4ad56998f1 Restore support for exclusion-only domain filters for AWS provider 2022-06-29 12:24:38 -05:00
Will Hegedus
b5d01eed1a feat: add debug logging for IP addr parse errors
Log whenever a target is not able to be parsed as an IP address. This is expected
to occur fairly often (for example, with CNAME targets), but allows more visibility
into how targets are being compared.

NOTE: depending on the number and type of targets, this could be quite noisy.
2022-06-06 13:06:43 -04:00
Will Hegedus
0c8f6a69bd feat!: handle IP address comparison
Previously there was no distinction between an IP address and any other string
when doing a comparison to determine which is "less" when determining which endpoint to actually create.

This explicitly handles IP addresses and will always prefer
them over non-IP addresses when determining which of two targets is less.
2022-04-20 13:35:28 -04:00
Tobias Krischer
692f2bbc23
add target filters based on network 2022-04-08 19:29:58 +02:00
Christian Groschupp
f9145981c3
infoblox: also create a ptr entry 2021-09-30 15:42:14 -07:00
Kubernetes Prow Robot
b8767ab077
Merge pull request #2113 from bynare/feature-matchparent
Feature matchparent
2021-06-23 00:26:10 -07:00
Kubernetes Prow Robot
55b7119153
Merge pull request #2010 from tjamet/limit-required-aws-calls-only
Reduce AWS Route53 API calls
2021-06-23 00:00:10 -07:00
Eugene Venter
fc37ff0f2c endpoint/domain_filter.go: add MatchParent DomainFilter method 2021-05-31 10:03:06 +12:00
Eugene Venter
d228a99ac8 domain_filter_test.go: generate empty string exclusions if no exclusions
for TestDomainFilterWithExclusions
2021-05-26 11:53:59 +12:00
Eugene Venter
bd83a472e8 domain_filter_test.go: amend exclusion test data
so all relevant tests get run in TestDomainFilterMatch
2021-05-26 11:52:50 +12:00
Eugene Venter
98171abe96 domain_filter_test.go: TestDomainFilterMatch ensure all tests are run
Don't skip the whole test on first "exclusion" encountered in test data.
Rather log a message and continue, as there could be more valid test
data.
2021-05-26 11:47:57 +12: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
Enrique Gonzalez
a09c416fc8
Merge remote-tracking branch 'origin/master' into df-regex 2021-03-30 15:19:46 +02:00
Dinar Valeev
a143a6cd59 Generate CRD with controller-gen
Signed-off-by: Dinar Valeev <dinar.valeev@absa.africa>
2021-03-08 20:12:05 +01:00
Enrique Gonzalez
fd365034da
git: merge upstream master
Signed-off-by: Enrique Gonzalez <goga.enrique@gmail.com>
2021-03-03 12:05:11 +01:00
Rob Selway
0a9daa9e9b Case insensitivity when comparing targets 2021-02-14 13:40:25 +00:00
Enrique Gonzalez
e3c14b5490
refactor: regexp types for filter and add tests 2021-02-10 12:38:57 +01:00
Enrique Gonzalez
76817b350f
git: merge upstream master
Signed-off-by: Enrique Gonzalez <goga.enrique@gmail.com>
2020-11-03 16:29:36 +01:00
windayski
262822e2f6 fix typos 2020-10-30 03:28:57 +00:00
Yury Tsarev
904d8e4c87 NS record support 2020-10-12 20:23:17 +02:00
Enrique Gonzalez
dea8bce9fe
Merge remote-tracking branch 'upstream/master' into df-regex 2020-08-10 11:27:11 +02:00
Lucas Servén Marín
a54ee2da37
*: fix goreportcard golint warnings
This commit applies fixes for the golint warnings shown on goreportcard.

Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
2020-05-07 17:22:36 +02:00
Enrique Gonzalez
c5e0227180
feat: add regex domain filters
Signed-off-by: Enrique Gonzalez <goga.enrique@gmail.com>
2020-04-09 14:37:45 +02:00
Markus Cisler
14d64e09f2 Change DomainFilter to apply to records as well
This moves `domain_filter.go` to the `endpoint` package to make it
possible to filter and exclude record names in
`plan.filterRecordsForPlan()` so it does not have to be implemented in
every single provider.

Because some providers access `DomainFilter.filters` directly it had to
be exported.
2020-02-24 11:19:45 +01:00
Tariq Ibrahim
394f46cd64
uprade golangci-lint and add megacheck & interface linters 2020-01-23 14:49:23 -08:00
Alfred Krohmer
6681a3a358 Add support for all AWS Route53 routing policies; add additional SetIdentifier abstraction layer
This adds support for all AWS Route53 routing policies, namely:
* simple (default)
* weighted
* latency
* failover
* geolocation
* multi value answer

These routing policies allow to create multiple records with the same
name, but different "SetIdentifiers". Therefor, as a prerequisite for
implementing support for above routing policies, there is a new
"abstraction layer" added that handles this SetIdentifier by adding a
new attribute in the Endpoint struct and adding another level in the
plan table.
2019-09-10 20:47:36 +02:00
twilfong
d68d06f17c add dualstack support for AWS provider with ALB ingress controllers 2019-06-26 18:05:22 -07:00
Erik Swets
e0e7a9defd Allow setting Cloudflare proxying by annotation 2018-11-16 12:52:47 +01:00
Martin Linkhorst
f21f45b15d
fix(aws): correctly populate target health check on existing records 2018-10-02 17:44:02 +02:00
shashidharatd
cf11761b71 Auto generated deepcopy functions for DNSEndpoint CRD 2018-08-22 19:37:21 +05:30
shashidharatd
ddef0a9ccc Add wrapper structure for Endpoint in sync with definition of CRD 2018-08-22 19:37:21 +05:30
Gary Kramlich
2ee4b2e533 Add support for NodePort services (#559)
* First stab at NodePort support. Testing incomplete

* Fix up the unit tests

* Remove some deadcode in the unittests

* gather node ips once and add support for srv records

* Make sure we match gofmt simple

* Move the nodes to the testcase and add a test for clusters that only have internal ip addresses

* Somehow forgot about the weight field in the records

* Add SRV as a supported record type
2018-06-14 18:08:05 +02:00
Jaromir Vanek
cd94888800 Implementation of AWS ServiceDiscovery provider 2018-05-25 07:45:47 -07:00
Gary Kramlich
0d0c171811 Add some additional tests for Target.Same 2018-04-12 11:22:33 -05:00
Gary Kramlich
1cef71e0be Inititial support for multiple targets per record 2018-03-13 23:16:51 -05: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
Yerken
ec07f45c8e Multi target plan ( Page Not Found ) (#404)
* Make suitableType() be Endpoint method

With this change it becomes possible to work with endpoint
of empty type in packages other than "provider". Also
it seems logical for a smart property getter without side effects
to be a method rather than a function in different package

* Make plan computation work correctly with multi-target domains

* fix drawing

* drop comments

* fix boilerplate header

* fix comment

* fix the bug with empty map

* rework registry to support random lables

*  serialize->serializeLabel function rename

* golint for err variable naming

* add additional test

* add tests for current case where one resource can generate multiple endpoints

* make labels have its own type, add serialization as a method

* add comment for exported error

* use greater rather than not equal zero

* update changelog
2017-12-14 11:21:07 +01:00
Kevin J. Qiu
71723bdd5b Allow specifying a custom TTL through annotation on Ingress or Service (#320)
* Add RecordTTL

* Route53: test for custom TTL

* Fix tests

* Fix remaining tests

* Add ttl when endpoint is created from ingress

* Missed a word

* Fix bad refactoring

* Add ingress custom TTL test

* gofmt

* Satisfy go-lint

* Unshadow `endpoint` in azure provider

* Fix and add an output test

* Add TTL for endpoints generated from service templates

* Take TTL into account when generating update plan

* Tests for TTL change impact on the plan

* Refactor factory method name

* Refactoring

* Run gofmt

* Make endpoint string format look like BIND config

* Update plan and plan_test

* Replace NewEndpointWithTTLValue with NewEndpointWithTTL in aws

* Remove NewEndpointWithTTLValue func

* Update references to TTL

* Remove getTTLValue func

* Handle merge conflict

* Update tests

* Update README, CHANGELOG and documentation

* Run gofmt

* Move getTTLFromAnnotations to a common file

* Refactor getTTLFromAnnotations

* Gofmt

* Add tests for getTTLFromAnnotations

* Trigger build

* Add boilerplate header

* Update README/CHANGELOG according to code review

* Add ttl.md and link it from README

* change CNAME string to endpoint.RecordTypeCNAME

* fix test cases with AWS ALIAS records, these do not behave different in these tests
2017-10-11 14:17:02 +02:00
Seth Pollack
f14a953b5f Kops Compatibility #1: Set RecordType at source (#248)
* set RecordType at source

* add comments for linting
2017-08-25 14:41:40 +02: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
Yerken
82a172a9f9 minor improvements to logging (#175)
* minor improvements to logging

* chore(*): change log.Infoln to log.Info

* fix: fix incorrect example code
2017-04-26 12:06:16 +02:00
Yerken
5e3f2b7773 first effort to improve logging in external-dns to provide with basic needed logging (#174)
* continue on controller loop error

* add logging in source

* use formatter on logChanges for endpoints

* fix log messages, log skipped records

* add logging in aws, uppercase the rest

* respect google dry run policy

* add ing/svc namespace/name on logging

* fix error logging on template failure

* fix bugs, propagate template error

* log if nothing is being updated, debug log skipped endpoints

* change zone-not-found logging order
2017-04-25 12:22:46 +02:00
Yerken
98de0142ba kickoff txt registry (#137)
* kickoff txt registry

* fix inmemory dns provider to include recordtype info for validation

* Merge master

* fix ununsed variable in inmemory provider

* add tests for records

* add test for no prefix name formatter

* implement apply changes with tests

* add flag to enable txt registry

* add txt registry to main

* improve sort testing

* filter out non-owned records

* NewEndpoint(...) requires record type

* use newendpoint in aws_test, fix tests

* change suitable type implementation

* fix the test for compatibility component

* change inmemory provider to include recordtype and use suitable type

* fix comments, CNAME should target hostname

* name mapper do not use pointer on struct

* txt prefix - just concatenate, remove spew, fix txt record label

* allow TXT records as result from dns provider

* add changelog

* fix tests

* TXT records need to be enclosed in double quotes
2017-04-11 23:10:38 +02:00
Yerken
3d296f37d9 Fix/plan reuse current record (#145)
* inherit labels from dns provider records

* do not change import statements, rollback autoformatter changes

* add comment for the public method
2017-04-11 20:27:51 +02:00
Yerken
be452acdf7 endpoint sanitize dns in the init func (#131)
* revert changes, start a new

* remove sanitize

* fix tests for source pkg

* fix aws_tests
2017-04-07 10:18:52 +02:00
Yerken
2eb97f6a83 add labels to endpoints (#121)
* add labels to endpoints

* reset to first commit fix label key

* compare using sameendpoint, add map initializer to newendpoint

* fix(endpoint): drop superflous comment indicators
2017-04-04 21:41:13 +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
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
Martin Linkhorst
6ab387ec33
docs(endpoint): document the Endpoint struct 2017-02-24 17:16:57 +01:00
Martin Linkhorst
f156cd89d7
chore(source): add boilerplate headers 2017-02-24 17:16:26 +01:00
Martin Linkhorst
84910c4844
feat(services): implement Kubernetes services source 2017-02-23 12:04:13 +01:00