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

add ability to disable nodePort Support

Open jpiper opened this issue 1 year ago • 19 comments

Description

When running external-dns in a multi-tenant environment (e.g. in namespaced=true mode in the helm chart), users may not be in a position to give access to the Node resource to the external-dns deployment. At the moment, external-dns will not function without access to the Node resource as a Node informer is always created by the Pod and Service sources.

In this PR I add the flag --ignore-nodeports that disables the Node informer and then ensures the Pod and Service sources makes no attempt to try and retrieve any information from the Node resource.

jpiper avatar Sep 05 '24 13:09 jpiper

Welcome @jpiper!

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 Sep 05 '24 13:09 k8s-ci-robot

Hi @jpiper. 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 Sep 05 '24 13:09 k8s-ci-robot

/ok-to-test

munnerz avatar Sep 05 '24 13:09 munnerz

Thanks, this PR looks good, is tested and documented 👍 .

As Albert Camus said:

To name things wrongly is to add to the misfortune of the world

If I understand correctly, when external-dns is namespaced, it does not make sense to set ignoreNodePorts to true.

So, 🤔 wdyt of renaming ignore-nodeports cli args into namespaced ? And so, in the chart, when namespaced is enabled, it would add this --namespaced=true that would disable the informer ?

It really depends, in an environment where you have access to the node resource, you could still run in the namespaced mode with the nodeinformer enabled, it really depends on your multi-tenancy model of your cluster. I have seen people give tenants access to the node resource, and likewise, multi-tenant clusters where you are not allowed to view the node resource. However, I agree, the naming could be improved. How do we feel about disableNodeSupport?, which then really implies that node hostnames/IPs will not be able to be synced?

jpiper avatar Oct 04 '24 08:10 jpiper

alternatives I can think of for the flag:

--(disable|ignore)-node-(info|data|resources)
--disable-node-informer (leaks implementation details)

jpiper avatar Oct 04 '24 09:10 jpiper

It really depends, in an environment where you have access to the node resource, you could still run in the namespaced mode with the nodeinformer enabled,

I am sorry: I do not understand this. When one is namespaced, AFAIK there is no Cluster RBAC. so there is no access possible to node, since it's a Cluster-wide resources.

Did I miss something ?

mloiseleur avatar Oct 04 '24 09:10 mloiseleur

It really depends, in an environment where you have access to the node resource, you could still run in the namespaced mode with the nodeinformer enabled,

I am sorry: I do not understand this. When one is namespaced, AFAIK there is no Cluster RBAC. so there is no access possible to node, since it's a Cluster-wide resources.

Did I miss something ?

ah yes, this is my fault, sorry. I am getting confused between how the chart works and how one could theoretically deploy external-dns using a namespace scope but still using cluster resources. The chart doesn't support this deployment mode though so you're right, I can disable the node informer with the helm namespaced helm value is set to true

jpiper avatar Oct 04 '24 09:10 jpiper

/lgtm

mloiseleur avatar Oct 27 '24 13:10 mloiseleur

/assign @Raffo

mloiseleur avatar Dec 22 '24 17:12 mloiseleur

New changes are detected. LGTM label has been removed.

k8s-ci-robot avatar Jan 27 '25 11:01 k8s-ci-robot

[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 raffo. 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 Jan 27 '25 11:01 k8s-ci-robot

I have rebased the PR

jpiper avatar Jan 27 '25 12:01 jpiper

cc @ivankatliarchuk

mloiseleur avatar Jan 28 '25 08:01 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 Jan 29 '25 01:01 k8s-ci-robot

@jpiper Do you think you can rebase and address @ivankatliarchuk review comments ?

mloiseleur avatar Feb 15 '25 08:02 mloiseleur

Yes I can 1 but I am on holiday for the next week. I can get to it on the 24th Feb!Sent from my iPhoneOn 15 Feb 2025, at 08:42, Michel Loiseleur @.> wrote: @jpiper Do you think you can rebase and address @ivankatliarchuk review comments ?—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.>

mloiseleur left a comment (kubernetes-sigs/external-dns#4727) @jpiper Do you think you can rebase and address @ivankatliarchuk review comments ?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

jpiper avatar Feb 15 '25 09:02 jpiper

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 16 '25 09:05 k8s-triage-robot

The Kubernetes project currently lacks enough active 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 rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

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

/lifecycle rotten

k8s-triage-robot avatar Jun 15 '25 10:06 k8s-triage-robot

/remove-lifecycle rotten

timbunce avatar Jun 15 '25 11:06 timbunce

There has been no answer since 5 months, so I close this PR. Feel free to re-open or open a new one if you need it. /close

mloiseleur avatar Jul 06 '25 22:07 mloiseleur

@mloiseleur: Closed this PR.

In response to this:

There has been no answer since 5 months, so I close this PR. Feel free to re-open or open a new one if you need it. /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-sigs/prow repository.

k8s-ci-robot avatar Jul 06 '25 22:07 k8s-ci-robot