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

Kops Compatibility #2: Add Multi-Target Support #326

Closed
wants to merge 1 commit into from

Conversation

sethpollack
Copy link
Contributor

No description provided.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 29, 2017
plan/plan.go Outdated
Current []*endpoint.Endpoint
// List of desired records
Desired []*endpoint.Endpoint
CurrentTargets map[RecordKey][]string
Copy link
Contributor

Choose a reason for hiding this comment

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

It's a bit nit picky, but I would say the Current/Desired are still appropriate. The CurrentTargets made me do a double take on what the map actually represented. The RecordKey makes it more than just the Target

@linki
Copy link
Member

linki commented Sep 1, 2017

I just tested this on GCP and it worked fabolous. I'll need to do lots of testing on AWS.

@jrnt30
Copy link
Contributor

jrnt30 commented Sep 1, 2017

I will deploy this to our cluster in AWS as well.

for _, ep := range eps {
targets := []string{}
for _, target := range ep.Targets {
if ok := isAWSLoadBalancer(ep.RecordType, target); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: you could simplify this to just if isAWSLoadBalancer(ep.RecordType, target) {

@@ -21,20 +21,58 @@ import (
"github.com/kubernetes-incubator/external-dns/endpoint"
)

// RecordKey is used to group records
type RecordKey struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is not used outside of plan, it should not be exported.

@linki
Copy link
Member

linki commented Oct 12, 2017

I'll try to merge this with master.

@szuecs
Copy link
Contributor

szuecs commented Nov 14, 2017

@sethpollack would you rebase and fix the comments, please?

@jrnt30
Copy link
Contributor

jrnt30 commented Nov 14, 2017

Is there a timeline/commitment to get this merged in then? I know that this will be at least the 3rd time there has been a major rebase to get this merged in.

@szuecs
Copy link
Contributor

szuecs commented Nov 15, 2017

@linki can you please comment. Kops would be a major step forward

@@ -43,7 +43,7 @@ func (ms *dedupSource) Endpoints() ([]*endpoint.Endpoint, error) {
}

for _, ep := range endpoints {
identifier := ep.DNSName + " / " + ep.Target
identifier := ep.DNSName + " / " + ep.Targets[0]

Choose a reason for hiding this comment

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

why only first target is considered ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We only aggregate the targets in the plan, so at this point we would only have 1 target

@@ -73,7 +73,7 @@ func (im *TXTRegistry) Records() ([]*endpoint.Endpoint, error) {
endpoints = append(endpoints, record)
continue
}
ownerID := im.extractOwnerID(record.Target)
ownerID := im.extractOwnerID(record.Targets[0])

Choose a reason for hiding this comment

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

keeping ownerID in the target is probably not the best idea as it seems now.

@ideahitme
Copy link

ideahitme commented Nov 21, 2017

was this tested on Route53 ? If anyone has tried it on Route53 please let us know
/cc @linki u confirmed above it works on GCP, any chance u tried it on Route53 as well ?

@@ -271,12 +269,39 @@ func changesByZone(zones map[string]*route53.HostedZone, changeSet []*route53.Ch
return changes
}

func expandAliasTargets(eps []*endpoint.Endpoint) (endpoints, aliasTargets []*endpoint.Endpoint) {

Choose a reason for hiding this comment

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

does it expand or it splits alias from rest ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, i guess split makes more sense

@sethpollack
Copy link
Contributor Author

@ideahitme I tested with Route53 a few months ago.

@tamalsaha
Copy link
Contributor

@sethpollack, do you mind rebasing it?

@sethpollack
Copy link
Contributor Author

@tamalsaha not until we are actually ready to merge it. I already did a few rebases and its a ton of work.

@tamalsaha
Copy link
Contributor

ah! I know exactly what you mean!

@linki
Copy link
Member

linki commented Feb 22, 2018

@sethpollack We recently merged another branch adding multi-target support: #418. It's structurally possible to have a list of targets now, however full multi-target functionality only works on Google at the moment.

I'll review your PR soon again to see if we missed anything that you solved here.

I remember you already started work on a NodeSource and PodSource. Would you care to share them? They would make a lot of sense now.

@linki
Copy link
Member

linki commented Oct 2, 2018

Multi-target functionality has successfully landed in another PR. Therefore I'm closing this. Feel free to re-open if you think it's wrong.

Thanks @sethpollack for all your effort!

@sethpollack I remember you already started work on a NodeSource and PodSource. Would you care to share them? They would make a lot of sense now.

@linki linki closed this Oct 2, 2018
lou-lan pushed a commit to lou-lan/external-dns that referenced this pull request May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/multiple-targets cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants