Commit Graph

59 Commits

Author SHA1 Message Date
Morre
c0a183b006
fix: re-add api-approved.kubernetes.io annotation 2024-05-21 09:27:03 +02:00
Leonardo Quatrocchi
05ca35e228 Merge remote-tracking branch 'origin/master' into bugfix/group-endpoints-per-hosted-zone-for-aws 2024-04-22 20:36:38 -03:00
dongjiang
b5ef2fc913
Update endpoint/endpoint.go
Co-authored-by: Michel Loiseleur <97035654+mloiseleur@users.noreply.github.com>
2024-04-07 09:44:08 +08:00
Leonardo Quatrocchi
d9b743922a Specify and clarify root cause of issue 4241 2024-04-06 03:25:05 -03:00
Leonardo Quatrocchi
4fb2f2e283 Specific bugfix near the root cause for duplicated deletes on plan.go 2024-04-05 01:29:38 -03:00
Leonardo Quatrocchi
deba1ea445 Fix suggestions 2024-04-04 21:15:48 -03:00
leonardocaylent
3ca4d0250f
Update endpoint/endpoint.go
Co-authored-by: Eric Bailey <yurrriq@users.noreply.github.com>
2024-04-04 16:35:21 -03:00
Leonardo Quatrocchi
6066b700b8 Fix for duplicated endpoints 2024-04-04 01:24:05 -03:00
dongjiang1989
dc9e0a5816
dongjiang, fix ipv6 shortener and expander equal
Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
2024-03-31 19:51:28 +08:00
Leonardo Quatrocchi
2b3da1b608 Fix for duplicated endpoints and unit tests 2024-03-29 23:27:25 -03:00
Leonardo Quatrocchi
7fe2d3f069 Fix for duplicated endpoints and unit tests 2024-03-29 03:39:17 -03:00
Leonardo Quatrocchi
82046ccb15 Removing comments and clean up 2024-03-16 15:05:59 -03:00
Leonardo Quatrocchi
0ca279694a Fix Lint 2024-03-16 11:41:26 -03:00
leonardocaylent
30c9e77765
Fix lint 2024-03-16 00:00:00 -03:00
leonardocaylent
a3826d541b
Update endpoint.go with Key function 2024-03-15 22:56:02 -03:00
Leonardo Quatrocchi
294b4c673e Fix format on aws and endpoint files 2024-03-05 02:35:13 -03:00
Leonardo Quatrocchi
846f4b40fa Going back to endpoint.go 2024-03-05 02:27:20 -03:00
Joel Studler
2fdc7354c0 Add unit tests for NAPTR and invalid endpoints 2024-01-27 13:16:53 +01:00
Kyle Cronin
20bff0aae5 Remove EndpointFilterInterface 2023-08-16 23:48:30 -04:00
Kyle Cronin
7fb144d8d8 Fix planning for multi-cluster dual stack record types
When AAAA multi-target / dual stack support was
added via #2461 it broke ownership of domains across
different clusters with different ingress records types.

For example if 2 clusters manage the same zone,
1 cluster uses A records and the other uses CNAME
records, when each record type is treated as a separate
planning record, it will cause ownership to bounce back
and forth and records to be constantly created and
deleted.

This change updates the planner to keep track of multiple
current records for a domain. This allows for A and AAAA
records to exist for a domain while allowing record type
changes.

The planner will ignore desired records for a domain that
represent conflicting record types allowed by RFC 1034 3.6.2.
For example if the desired records for a domain contains
a CNAME record plus any other record type no changes for
that domain will be planned.

The planner now contains an owned record filter provided
by the registry. This allows the planner to accurately plan
create updates when there are record type changes between
the current and desired endpoints. Without this filter the
planner could add create changes for domains not owned
by the controller.
2023-08-15 19:37:50 -04:00
John Gardiner Myers
a9ae5ea43a Add SetIdentifier to EndpointKey 2023-06-18 16:47:37 -07:00
John Gardiner Myers
4417ad4894 Move EndpointKey to endpoints package 2023-06-18 16:47:37 -07:00
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
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
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
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
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
Christian Groschupp
f9145981c3
infoblox: also create a ptr entry 2021-09-30 15:42:14 -07: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
Rob Selway
0a9daa9e9b Case insensitivity when comparing targets 2021-02-14 13:40:25 +00: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
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
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
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
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
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
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