Commit Graph

66 Commits

Author SHA1 Message Date
John Gardiner Myers
94713c20c6 Add --exclude-record-types flag 2023-09-15 18:45:09 -07:00
Kubernetes Prow Robot
030342f445
Merge pull request #3747 from cronik/bugfix/dual-stack-records
Fix planning for multi-cluster dual stack record types
2023-09-14 22:24:12 -07:00
Kyle Cronin
55ae13ef21 Plan record type conflict should prefer A and AAAA records
endpoint.Targets.Less gives priority to A and AAAA over CNAME records so the
plan record type conflict resolver should also prefer A/AAAA.
2023-09-03 15:58:27 -04:00
Kubernetes Prow Robot
0a6574a982
Merge pull request #3860 from johngmyers/refactor
Remove DomainFilterInterface
2023-09-01 07:54:50 -07:00
Kyle Cronin
cf756a76b2 Extract record types conflict resolver 2023-08-29 23:41:46 -04: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
5339c0c72c Fix reconciliation of provider-specific properties 2023-08-11 20:53:26 -07:00
John Gardiner Myers
e9be5887bd Remove DomainFilterInterface 2023-08-11 13:01:22 -07:00
John Gardiner Myers
5affab0561 Remove PropertyValuesEqual method from Provider interface 2023-08-04 04:56:43 -07:00
Matias Charriere
df5e9aeace
remove ForceUpdate property on endpoint after reimplementation
Signed-off-by: Matias Charriere <matias@giantswarm.io>
2023-06-15 11:50:05 +02:00
Matias Charriere
1bd3834743
handle missing TXT records with a forcedUpdate strategy
This change tries to remove part of the logic added in 50f196c0db.
The forceUpdate strategy relies on existing code of the planner to migrate TXT records to the new format,
being the main goal to avoid conflicts during apply.

Signed-off-by: Matias Charriere <matias@giantswarm.io>
2023-06-15 11:50:04 +02:00
John Gardiner Myers
ba26db45ce Simplify planner's data structure 2023-04-13 19:28:54 -07:00
John Gardiner Myers
94d09b37dc Separate plan by record type 2023-03-30 17:47:59 -07:00
Raffaele Di Fazio
82a554e775
Revert "fix: New provider specific update" 2022-11-29 10:05:26 +01:00
Gustavo Veloso
ca07f0a8ca New provider-specific properties support when updating DNS records
shouldUpdateProviderSpecific seems to be iterating over just the current properties that were previously set, not taking into consideration for planning changes when additional ProviderSpecific properties were just set.

The previous code version only iterates over current ProviderSpecific properties. This new version iterates over desired properties, including those that were just set.
2022-11-21 19:42:39 -03:00
Andy Bursavich
74ffff6c26 gofumpt 2022-09-20 20:48:57 -07:00
Andrey Lebedev
50f196c0db Handle the migration to the new TXT format: create missing records 2022-07-13 21:49:27 +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
Raffaele Di Fazio
daeee26684
Add flag to opt in for NS records management (#1915)
* adds flag to opt in for NS records management

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* go fmt

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* goimports

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* fix more tests

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* go fmt again

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* fix test

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* more tests

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* make ordering of managed records consistent

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* fix flag

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>
2021-01-12 06:32:26 -08:00
Raffaele Di Fazio
f5aa1c4c37
Add new method to provider interface to implement provider specific changes (#1868)
* adds tests for shouldUpdateProviderSpecific

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* move AWS health to where it belongs

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* add test that breaks things

Signed-off-by: Raffaele Di Fazio <difazio.raffaele@gmail.com>

* adds adjustendpoints method

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* fix controller

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* actually pass the provider where needed

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* OMG goland do your go fmt thing

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* use registry as proxy

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* make linter happy

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* change AdjustEndpoints signature

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* fix typo

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* actually use adjusted endpoints

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* revert cloudflare change

Signed-off-by: Raffaele Di Fazio <raffo@github.com>

* Update provider/cloudflare/cloudflare.go

Co-authored-by: Nick Jüttner <nick@juni.io>

Co-authored-by: Nick Jüttner <nick@juni.io>
2020-12-09 23:40:54 -08:00
Yury Tsarev
904d8e4c87 NS record support 2020-10-12 20:23:17 +02:00
Adam Stankiewicz
e8f301ec35 Remove unnecessary import 2020-06-01 10:26:12 +02:00
Adam Stankiewicz
d6bb3ef82c
Update plan/plan.go
Co-authored-by: Raffaele Di Fazio <raffo@github.com>
2020-05-31 20:07:43 +02:00
Adam Stankiewicz
5bb3b7da20
Update plan/plan.go
Co-authored-by: Raffaele Di Fazio <raffo@github.com>
2020-05-31 20:07:34 +02:00
Adam Stankiewicz
98b26d73dd Apply fixes for custom comparators 2020-05-30 18:34:54 +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
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
41ba7f1ff5
rename project root package to sigs.k8s.io 2020-01-06 08:08:35 -08:00
Nick Jüttner
9418e3acd8
Merge pull request #1008 from devkid/feature/aws-routing-policies
[RFC] Add support for all AWS Route53 routing policies; add additional Setldentifier abstraction layer
2019-11-19 11:21:12 +01: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
Alfred Krohmer
b2a3e88303 Fixes and cleanup 2019-09-10 20:47: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
Joe Hohertz
8b1c157802 fix test of ProviderSpecific comparison
Signed-off-by: Joe Hohertz <joe@viafoura.com>
2019-02-08 08:46:05 -05:00
Martin Linkhorst
69b951d7b2
only compare provider-specific annotations when they exist in the provider, skip target-health annotation 2019-01-30 11:37:48 +01:00
Nick Jüttner
6d39526069
Merge branch 'master' into cloudflare-proxied-annotation 2019-01-24 11:16:54 +01:00
Kubernetes Prow Robot
7918693b20
Merge pull request #833 from justinsb/normalize_dns_names_trailing_dot
Normalize DNS names during planning
2019-01-17 01:04:29 -08:00
Erik Swets
a5441bddea Support updating ProviderSpecific property. 2019-01-11 20:15:54 +01:00
Justin SB
173ef2ea4b Normalize DNS names during planning
Ensure that we don't consider names with and without a trailing dot
differently at this stage.
2018-12-27 12:41:13 -05:00
Justin SB
3c646a39a1 Implement Stringer for planTableRow
Makes for clearer log messages.
2018-12-27 12:35:58 -05:00
Martin Linkhorst
b5b8d618e9
Merge branch 'master' into txtRecordHandling 2018-07-23 13:52:22 +02:00
Nick Jüttner
54f5431ef0 chore 2018-06-20 17:41:03 +02:00
Nick Jüttner
7bbba61be6 Remove errors 2018-06-20 17:18:35 +02:00
Nick Jüttner
6391ddb92a Removing the regex 2018-06-08 17:49:01 +02:00
Nick Jüttner
531d465c24 Adding more test records 2018-06-07 13:52:46 +02:00
Nick Jüttner
7a759bd8df Referencing to RFC and add more unit tests
Signed-off-by: Nick Jüttner <nick@juni.io>
2018-06-04 13:40:11 +02:00
John Chadwick
8cba60b53f Add comments explaining filterRecordsForPlan. 2018-06-03 14:27:24 -04:00
John Chadwick
d934f693ff Fix TXT record planning. 2018-06-01 09:08:17 -04:00
Nick Jüttner
62e30eaed9 More context
Signed-off-by: Nick Jüttner <nick@juni.io>
2018-06-01 09:39:59 +02:00
Nick Jüttner
52819663f8 Better naming plus minor changes
Signed-off-by: Nick Jüttner <nick@juni.io>
2018-06-01 09:31:21 +02:00