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

Target detection with NodePort ingress

Open jon4hz opened this issue 2 years ago • 7 comments

What happened: When an ingress controller is running with a NodePort service instead of LoadBalancer, external-dns tries to create the dns entry with the cluster internal IP from the ingress service.

I think this happens because external-dns reads the IP only from the ingress object directly: https://github.com/kubernetes-sigs/external-dns/blob/a68da28241558b5c2d84db5757c2587238508f14/source/ingress.go#L293-L306

I figured out that this can be overwritten by the external-dns.alpha.kubernetes.io/target annotation. However I would have add this annotation to every ingress definition and manually update them every time a cluster node changes. I don't think this is very dynamic and can't be handled on the long run.

What you expected to happen: External-dns should be smart enough to detect that the ingress is running without LoadBalancer or have an option to specify that. The DNS entries from such an ingress should contain either the public or private IPs of the cluster nodes. (depending on the external-dns.alpha.kubernetes.io/access annotation). When the IP of a cluster node changes, or the cluster get more/less nodes, external-dns should also update the dns records accordingly.

How to reproduce it (as minimally and precisely as possible):

  • deploy nginx-ingress with service type NodePort
  • create an ingress
  • Watch how external-dns creates an entry with the cluster internal IP

Anything else we need to know?: Maybe you could add an extra annotation, to tell external-dns, that it should extract the targets from the ingresses service definition instead from the ingress itself.

Environment:

  • External-DNS version (use external-dns --version): v0.13.1
  • DNS provider: rfc2136

jon4hz avatar Dec 28 '22 23:12 jon4hz

/assign

kundan2707 avatar Feb 20 '23 10:02 kundan2707

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

This bot triages un-triaged issues 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 issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue 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 21 '23 11:05 k8s-triage-robot

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

This bot triages un-triaged issues 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 issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue 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 20 '23 11:06 k8s-triage-robot

/remove-lifecycle rotten

jon4hz avatar Jun 20 '23 12:06 jon4hz

Even without the annotation for ingress resources, the current implementation differs from the default behaviour described in the FAQ:

If this annotation is not set, and the node has both public and private IP addresses, then the public IP will be used by default.

Current implementation sets both the external and internal addresses of the ingress controller on the DNS record.

EternalDeiwos avatar Dec 19 '23 09:12 EternalDeiwos

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

This bot triages un-triaged issues 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 issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue 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 Mar 18 '24 10:03 k8s-triage-robot

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

This bot triages un-triaged issues 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 issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue 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 Apr 17 '24 11:04 k8s-triage-robot

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

This bot triages issues 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 issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

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

/close not-planned

k8s-triage-robot avatar May 17 '24 11:05 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

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

This bot triages issues 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 issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

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

/close not-planned

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 May 17 '24 11:05 k8s-ci-robot