external-dns icon indicating copy to clipboard operation
external-dns copied to clipboard

Adding `NS` support for Azure DNS

Open sebader opened this issue 2 years ago • 31 comments

Description

This adds support for managing NS records in Azure DNS as well. Not sure if there was a particular reason why this wasn't already there. Required in k8gb https://github.com/k8gb-io/k8gb/pull/912

Fixes #2826

I did update the unit tests but I do need some help on updating the one for deletion. I am not sure what is still missing but it's still failing:

--- FAIL: TestAzureApplyChangesZoneName (0.00s)
    azure_test.go:271: 
                Error Trace:    azure_test.go:271
                                                        azure_test.go:512
                Error:          Should be true
                Test:           TestAzureApplyChangesZoneName
                Messages:       expected and actual endpoints don't match. [deleted.foo.example.com 0 IN A   [] deletedcname.foo.example.com 0 IN CNAME   [] old.foo.example.com 0 IN A   [] oldcname.foo.example.com 0 IN CNAME   []]:[old.foo.example.com 0 IN A   [] oldcname.foo.example.com 0 IN CNAME   [] ns-old.nope.example.com 0 IN NS   [] deleted.foo.example.com 0 IN A   [] deletedcname.foo.example.com 0 IN CNAME   []]
FAIL

Checklist

  • [x] Unit tests updated
  • [x] End user documentation updated

sebader avatar Jun 21 '22 15:06 sebader

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: sebader / name: Sebastian (a9481faad7079cc440fbe770a0e3c47ccfacbac9, a4c607d367302b01a4ef19f7c7987804ac10cff2)

Welcome @sebader!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Jun 21 '22 15:06 k8s-ci-robot

@JAORMX as I wrote, this is not yet ready to be approved. One test is failing....

@njuettner @Raffo could you maybe please take a look at this and help me out so we can get this forward? thanks!

sebader avatar Jun 24 '22 08:06 sebader

@sebader: Anything remaining but the LGTMs?

Ziphone avatar Oct 18 '22 10:10 Ziphone

@Ziphone there is still the failing tests which I need help with

sebader avatar Oct 18 '22 10:10 sebader

/test ?

Ziphone avatar Oct 18 '22 14:10 Ziphone

@Ziphone: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test ?

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.

k8s-ci-robot avatar Oct 18 '22 14:10 k8s-ci-robot

@sebader: The test fails because it expects this record to get deleted: https://github.com/sebader/external-dns/blob/feature/sebader-azure-ns/provider/azure/azure_test.go#L508

What blocks the deletion is the domain filter of the test provider: https://github.com/sebader/external-dns/blob/feature/sebader-azure-ns/provider/azure/azure_test.go#L546

The test will pass if you replace the occurrences of ns-old.nope.example.com with e.g ns-old.foo.example.com (in file provider/azure/azure_test.go). Guess subdomain nope.example.com was introduced to ensure that External DNS will not tamper with records outside the scope of the domain filter.

Please involve me if you don't have time to get this change through. Very grateful for your initiative.

Ziphone avatar Oct 30 '22 21:10 Ziphone

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: JAORMX, sebader Once this PR has been reviewed and has the lgtm label, please assign szuecs for approval by writing /assign @szuecs in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 avatar Oct 31 '22 10:10 k8s-ci-robot

@Ziphone awesome, thanks so much for this! Indeed it fixed the failing test

ready for review :)

sebader avatar Oct 31 '22 10:10 sebader

Any thoughts on when we can get a review here, @Raffo?

Ziphone avatar Dec 01 '22 09:12 Ziphone

/assign @Raffo

ytsarev avatar Jan 26 '23 23:01 ytsarev

@sebader, thanks a lot for this work! Could you please squash the commits?

done

sebader avatar Jan 30 '23 16:01 sebader

PR looks good, can you add information to the docs that NS records will not work if the managed-record-type is not configured to also use NS records?

sorry, @Raffo I'm not sure what you refer to?

sebader avatar Feb 04 '23 19:02 sebader

@sebader without that flag ( see https://github.com/kubernetes-sigs/external-dns/blob/8e058caf83711370c3d8b1b3667ade5f471f0893/pkg/apis/externaldns/types.go#L426 ) the NS records will not work. We don't want to enable NS records by default because ExternalDNS was never made to manage all DNS records, rather to enable simpler PaaS like workflows in which apps want to expose DNS records. To make this feature usable by users, we need to add that information to the tutorial.

I would also ask if you end-to-end tested this with azure because we don't really have infra to test on azure at this time, I'd be great if you can verify that everything works.

Raffo avatar Feb 05 '23 10:02 Raffo

ah got it @Raffo. I added a note to the docs, is that ok?

Yes, I have tested the new NS records through k8gb - I guess there the managed-record-types is already set to enable NS under the hood, which is why I wasnt aware of this.

sebader avatar Feb 06 '23 17:02 sebader

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar May 07 '23 17:05 k8s-triage-robot

/remove-lifecycle stale

ytsarev avatar May 08 '23 21:05 ytsarev

PR needs rebase.

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.

k8s-ci-robot avatar May 16 '23 05:05 k8s-ci-robot

@sebader Do you think you can rebase this PR ?

mloiseleur avatar Dec 20 '23 15:12 mloiseleur

@sebader Sebastian Bader FTE Do you think you can rebase this PR ?

puh... I haven't touched this in ages and not even a working local setup for this at the moment. But if anybody else could pick this up, as you can see, the actual change was pretty minimal to re-create that from scratch.

sebader avatar Dec 20 '23 16:12 sebader

Ok. I'll close this PR then. If/when anyone needs it, a new PR can be opened. /close

mloiseleur avatar Dec 22 '23 12:12 mloiseleur

@mloiseleur: Closed this PR.

In response to this:

Ok. I'll close this PR then. If/when anyone needs it, a new PR can be opened. /close

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.

k8s-ci-robot avatar Dec 22 '23 12:12 k8s-ci-robot

/reopen

I would love to get this PR merged and avoid running a fork with NS support in https://github.com/k8gb-io/external-dns

ytsarev avatar Jan 02 '24 15:01 ytsarev

@ytsarev: Reopened this PR.

In response to this:

/reopen

I would love to get this PR merged and avoid running a fork with NS support in https://github.com/k8gb-io/external-dns

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.

k8s-ci-robot avatar Jan 02 '24 15:01 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: JAORMX Once this PR has been reviewed and has the lgtm label, please ask for approval from raffo. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 avatar Jan 02 '24 15:01 k8s-ci-robot

@ytsarev Sure. Do you think you can make your own or rebase this PR, then ?

mloiseleur avatar Jan 02 '24 15:01 mloiseleur

@mloiseleur yes, I will be also able to test it e2e

ytsarev avatar Jan 02 '24 16:01 ytsarev

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Apr 01 '24 16:04 k8s-triage-robot

/remove-lifecycle stale

ytsarev avatar Apr 01 '24 19:04 ytsarev