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

allow to associate aws dns records with health checks #1288

Merged

Conversation

rajatjindal
Copy link
Contributor

This PR allows to associate the DNS records with health checks. This helps in auto fail over in case one of the record is having issues.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 21, 2019
@rajatjindal
Copy link
Contributor Author

requesting feedback from @njuettner

@rajatjindal
Copy link
Contributor Author

gentle reminder @njuettner

@marcostvz
Copy link

marcostvz commented Dec 18, 2019

I just tested this PR in my environment, and it worked fine, using the following annotation:

external-dns.alpha.kubernetes.io/aws-health-check-id: {my-health-check-identifier}

@rajatjindal
Copy link
Contributor Author

kind reminder @njuettner

@rajatjindal
Copy link
Contributor Author

Requesting review from @linki @njuettner

provider/aws.go Outdated
@@ -317,6 +318,10 @@ func (p *AWSProvider) records(zones map[string]*route53.HostedZone) ([]*endpoint
default:
// one of the above needs to be set, otherwise SetIdentifier doesn't make sense
}

if r.HealthCheckId != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't depend on a SetIdentifier being set. Can you move that one level out?

Copy link
Member

Choose a reason for hiding this comment

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

good catch, @rajatjindal can you move it out of if r.SetIdentifier != nil ...? this shouldn't be in the clause.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it. I will make this change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am still testing it, in the meantime, can u confirm if we should check for aliasrecord? as this option is available only if we set aliasrecord to true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

requesting feedback from @devkid

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what you mean, a health check works with any target, not only alias records.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think @rajatjindal code is correct. Associating a custom health check to a record set in Route53 is only available to records with routing policies other than 'Simple'. Therefore, HealthCheckId should only be considered when SetIdentifier is also set. @njuettner could you please confirm?

Copy link
Member

@njuettner njuettner left a comment

Choose a reason for hiding this comment

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

One comment from @devkid and me, PTAL. Other than that LGTM 👍

@carlosrodf
Copy link

@njuettner is there a plan to merge this?
i was looking for this feature

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 25, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 21, 2020
@rajatjindal
Copy link
Contributor Author

Hi @devkid @njuettner

sorry for picking up this so late again.

I saw the inconsistency on health-check inside setIdentifier condition, and other outside that condition. thanks for pointing that out.

I think adding the health check annotation only works when the routing policy != "Simple", and also that would mean that setIdentifier should be set.

could you please confirm what u think about it.

many thanks

@barucoh
Copy link

barucoh commented Aug 6, 2020

Is there any plan to merge this? I am looking for this feature...

@seanmalloy
Copy link
Member

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 19, 2020
@njuettner
Copy link
Member

njuettner commented Aug 19, 2020

@rajatjindal to answer your question, from looking at the docs, healthcheckid seems not related if you set the identifier or not. https://docs.aws.amazon.com/Route53/latest/APIReference/API_ResourceRecordSet.html#Route53-Type-ResourceRecordSet-HealthCheckId

But it would make sense to check what ResourceRecordSet we have 'Alias' or 'Non-Alias' and checking if you have more than two or more resource record sets to respond to a DNS query.

And if I got this right you also need to have a health check in place which you have to create before right? Otherwise it wouldn't make sense to reference the id of the health check.

I think this needs to be added for our docs otherwise people don't know what external-dns is doing and what not.

@seanmalloy
Copy link
Member

@rajatjindal can you add some end user documentation that describes how this feature works? Also I think it would be good to rebase this because the newer GitHub actions CI checks have not run. Thanks!

@rajatjindal
Copy link
Contributor Author

sorry for replying late, was busy with some other work.

i will be looking at this PR today

@volk1234
Copy link

Long story short - when this will be landed?

@vinny-sabatini
Copy link
Contributor

@rajatjindal do you have time to add some end user documentation for this PR?

@volk1234 we are just waiting for the PR to be rebased and to get some documentation added, then we will work to get the official maintainers to review and hopefully merge this shortly after that.

@rajatjindal
Copy link
Contributor Author

apologies for delayed responses. i was dealing with some personal stuff. I will try to keep my replies current until this is merged.

@jbilliau-rcd
Copy link

Is this ready to be reviewed @rajatjindal ? If so, it looks like next step is to /assign @njuettner? We have a custom fork using this functionality and would love to come back to using the standard charts.

@rajatjindal
Copy link
Contributor Author

yes, this is ready for review. Happy to address if there are more review comments.

@jbilliau-rcd
Copy link

/assign @njuettner

We've been running this in production for months now, works great.

@Raffo
Copy link
Contributor

Raffo commented Oct 8, 2020

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 8, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Raffo, rajatjindal

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 8, 2020
@k8s-ci-robot k8s-ci-robot merged commit aea5b76 into kubernetes-sigs:master Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet