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

feat(ns1): optionally identify NS1 zone by handle instead of FQDN

Open cbertinato opened this issue 4 months ago • 13 comments

What does it do ?

This PR introduces the ability to explicitly override a zone FQDN with a "zone handle" for the NS1 provider, which is an organization-unique identifier for a zone in NS1.

Motivation

When a zone is created in NS1 and a zone handle is not specified, then the zone handle is the same as the zone FQDN. However, if a zone has been created with a zone handle that is different from its FQDN, then external-dns will fail to find that zone in NS1.

The functionality allows one to explicitly map an FQDN to a zone handle via flags:

--ns1-zone-handle-map=dev.example.com=dev-view

and by environment variable:

EXTERNAL_DNS_NS1_ZONE_HANDLE_MAP="example.com=corp-prod\ndev.example.com=dev-view"

If a zone handle override is not found for a given FQDN, then external-dns will default to using the FQDN to identify the zone.

More

  • [x] Yes, this PR title follows Conventional Commits
  • [x] Yes, I added unit tests
  • [x] Yes, I updated end user documentation accordingly

cbertinato avatar Aug 18 '25 19:08 cbertinato

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: cbertinato / name: Chris Bertinato (7736d29d9e36242254486d8c1fb84b5d315d3442, f3d3ad1c02bf31040d6920245729a48269b4e9e9, 3a7fd7d17918a9b94e8ade32a1b795cf3886962d, 83002157fe8406bf62bfffa343e2967681a41a72, 2a52eed52846d372ed34d56a0a0f616ff0574e51)

Welcome @cbertinato!

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 Aug 18 '25 19:08 k8s-ci-robot

Hi @cbertinato. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

k8s-ci-robot avatar Aug 18 '25 19:08 k8s-ci-robot

@mloiseleur you got it!

cbertinato avatar Aug 21 '25 02:08 cbertinato

/lgtm

mloiseleur avatar Aug 22 '25 06:08 mloiseleur

Could you share evidences that NS1 provider still works with and without this new flag?

ivankatliarchuk avatar Aug 24 '25 08:08 ivankatliarchuk

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from mloiseleur. For more information see the 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 Aug 24 '25 10:08 k8s-ci-robot

@ivankatliarchuk yes, I will do. Also, I will address all feedback @szuecs.

cbertinato avatar Aug 28 '25 14:08 cbertinato

@cbertinato we are near the merge. You need to rebase and fix the ci, a last review and we should be good to go.

mloiseleur avatar Sep 23 '25 07:09 mloiseleur

@mloiseleur thanks for the reminder! got busy and dropped a few things. will take care of this today.

cbertinato avatar Sep 24 '25 14:09 cbertinato

@cbertinato: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-external-dns-unit-test 3a7fd7d17918a9b94e8ade32a1b795cf3886962d link true /test pull-external-dns-unit-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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-sigs/prow repository. I understand the commands that are listed here.

k8s-ci-robot avatar Sep 24 '25 15:09 k8s-ci-robot

@cbertinato If you rebuild the flags with the Makefile target, it should fix the current issue with the CI.

mloiseleur avatar Sep 30 '25 06:09 mloiseleur

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-sigs/prow repository.

k8s-ci-robot avatar Nov 08 '25 18:11 k8s-ci-robot