Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AWS private hosted zones in addition to public zone #356

Merged
merged 9 commits into from
Jan 5, 2018

Conversation

coreypobrien
Copy link
Contributor

Fixes #335

Currently, either a public or a private hosted zone on AWS will be updated, but never two identically named hosted zones. This implementation updates any matching private hosted zones as well as the one best matching public zone.

I implemented as updating all private zones because of the way AWS private zones work with VPCs. When a private hosted zone is attached to a VPC, the private hosted zone is the only source of truth for all DNS records in that domain. There is no possibility of delegation or forwarding. Therefore although it is obvious that a record for a.sub.example.com should be placed in the public sub.example.com hosted zone, that record could legitimately be required in private zones sub.example.com and example.com.

When #322 is solved, it will allow users to choose specific private hosted zones to allow for more specificity and less sprawl.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 10, 2017
@ideahitme
Copy link

ideahitme commented Oct 24, 2017

LGTM

this needs to be rebased on master. Regarding the specific zone matching for AWS (as opposed to common zone filtering for other providers) seems fine to me, we can maybe come up with a common algorithm in the future.

@coreypobrien
Copy link
Contributor Author

👍 Rebased on master

@ideahitme
Copy link

ideahitme commented Oct 25, 2017

👍 from my side
@linki maybe u want to take as well

Copy link

@geojaz geojaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
thanks @coreypobrien

@k8s-ci-robot
Copy link
Contributor

@geojaz: changing LGTM is restricted to assignees, and only kubernetes-incubator org members may be assigned issues.

In response to this:

/lgtm
thanks @coreypobrien

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ideahitme
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 2, 2017
@@ -267,12 +267,15 @@ func changesByZone(zones map[string]*route53.HostedZone, changeSet []*route53.Ch
for _, c := range changeSet {
hostname := ensureTrailingDot(aws.StringValue(c.ResourceRecordSet.Name))

zoneID, _ := zoneNameIDMapper.FindZone(hostname)
Copy link
Member

@linki linki Nov 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zoneNameIDMapper seems unsed to me now. Can we remove it, @coreypobrien ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. Removed.

@linki linki removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 13, 2017
@szuecs
Copy link
Contributor

szuecs commented Nov 14, 2017

👍 @ideahitme @linki please merge, the last open comment was already fixed

@ideahitme
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 15, 2017
@ideahitme
Copy link

please one last thing, could you add the change to the changelog ?

@ideahitme ideahitme added needs-clarification and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Nov 16, 2017
@ideahitme
Copy link

@here would like to discuss first whether merging this will cause any issues in the future, if at some point we would like to support "stickiness" to certain hosted zones (instead of migrating record in case of dynamically adding new zones). We could possibly want to make zone part as part of the TXT record, and how this PR would affect this decision

@coreypobrien
Copy link
Contributor Author

@ideahitme Added the changelog

Targeting a specific hosted zone or a set of hosted zones when multiple match will be solved by #322. Right now, the records will be added to all private zones.

@coreypobrien
Copy link
Contributor Author

@ideahitme Where do you think we are on this? Do you think we could merge this now and handle any future concerns when those features are addressed?

@ideahitme
Copy link

@coreypobrien sorry for the delay, I think we should consider merging this PR this week, @linki did you already have a look ?

@coreypobrien
Copy link
Contributor Author

coreypobrien commented Jan 2, 2018

@linki any update?

@linki linki self-assigned this Jan 2, 2018
@linki linki added this to the cw01 milestone Jan 2, 2018
@linki
Copy link
Member

linki commented Jan 2, 2018

I'll try to get it in this week.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 5, 2018
@linki
Copy link
Member

linki commented Jan 5, 2018

Fixed a couple of minor things with the changelog.

@ideahitme @mikkeloscar @coreypobrien Do you think this change requires a minor version bump?

@mikkeloscar
Copy link
Contributor

I guess it makes sense to bump the minor version since the behavior might be unexpected for people with both public and private zones.

@linki
Copy link
Member

linki commented Jan 5, 2018

@mikkeloscar thanks for the feedback.

@linki linki merged commit 53011dc into kubernetes-sigs:master Jan 5, 2018
@linki
Copy link
Member

linki commented Jan 5, 2018

@coreypobrien Thanks for the PR!

ffledgling pushed a commit to ffledgling/external-dns that referenced this pull request Jan 18, 2018
…s-sigs#356)

* Update AWS private hosted zones in addition to public zone

* Sort slices for consistent ordering in TestAWSSuitableZones

* ref: use len to check for empty list of matched zones

* feat: mention contributors in changelog

* fix: move changelog entry to the unreleased section

* fix: add one more missing attribution to the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-clarification size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants