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

feat: resolve dns targets in ingress based records to create A/AAAA instead of CNAME #4255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

n-marton
Copy link

Description

Similar feature to the one added in #3554 but for ingress based records.
Turned off by default, if the flag is set it will resolve the target dns record, and create A/AAAA instead of CNAME.

Checklist

  • Unit tests updated
  • End user documentation updated

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 12, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @n-marton!

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. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 12, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @n-marton. 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 12, 2024
@k8s-ci-robot
Copy link
Contributor

[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 assign raffo for approval. 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

@n-marton n-marton force-pushed the feat/resolve-ingress-targets branch from 949bbf8 to 1f3c350 Compare February 12, 2024 08:10
@k8s-ci-robot
Copy link
Contributor

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

In response to this:

/ok-to-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.

@mloiseleur
Copy link
Contributor

Thanks for this PR @n-marton !
Would you please detail your use case ? Why you need this feature ?.
You'll need to add some documentation on this feature, 🤔 maybe on this page.
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 12, 2024
@n-marton n-marton force-pushed the feat/resolve-ingress-targets branch from 1f3c350 to 404d3bc Compare February 12, 2024 09:03
@n-marton
Copy link
Author

n-marton commented Feb 12, 2024

sure thing: so in cases, where you have an ingress controller listening on proxy protocol, but you also have to reach said ingress controller from inside the cluster, you actually have to work around the fact, that if the LoadBalancer type service has an IP, the traffic will never leave the cluster, now this is easily fixable if your LoadBalancer solution supports FQDNs as LoadBalancer status lets say IP octets separated by dashes under some domain, now these FQDNs don't necessary have to exist, you might resolve them via a Lua script with an ease, but in this case authority can be a problem, so much easier to do A/AAAA records then CNAMEs.

Added a line into the docs.

@n-marton
Copy link
Author

/ok-to-test

@szuecs
Copy link
Contributor

szuecs commented Feb 13, 2024

@n-marton why you do not use a similar setup as described in https://opensource.zalando.com/skipper/kubernetes/ingress-controller/#run-as-api-gateway-with-east-west-setup for cluster local traffic to the ingress controller?
It's simple and you do not rely on public DNS, which is more prone to error than the explained internal one.

@n-marton
Copy link
Author

@n-marton why you do not use a similar setup as described in https://opensource.zalando.com/skipper/kubernetes/ingress-controller/#run-as-api-gateway-with-east-west-setup for cluster local traffic to the ingress controller? It's simple and you do not rely on public DNS, which is more prone to error than the explained internal one.

maybe I am missing something, but I don't get how this would solve the proxy protocol listening problem

@n-marton
Copy link
Author

it was also referred here in the loadbalancer thread that it would also be needed to be done for ingresses

@n-marton
Copy link
Author

@szuecs @mloiseleur anything else required on this?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 5, 2024
Signed-off-by: n-marton <marton@natko.hu>
@n-marton n-marton force-pushed the feat/resolve-ingress-targets branch from 404d3bc to 4129f3c Compare March 7, 2024 12:08
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 7, 2024
@mloiseleur
Copy link
Contributor

I'm not sure to totally follow your use case 🤔. Anyway, the code looks good and the feature is documented.
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 7, 2024
@Tyrael
Copy link

Tyrael commented Mar 19, 2024

/assign @Raffo

@Tyrael
Copy link

Tyrael commented Apr 2, 2024

any update here, anything we can help with to move this forward?

@szuecs
Copy link
Contributor

szuecs commented Apr 8, 2024

/unassign @Raffo

#4255 (comment) said use case is unclear, so I would say we do not accept this PR right now.

For me it's more a feature request to your ingress controller that can orchestrate external-dns as they wish.

@@ -46,3 +46,6 @@ the values from that.

2. Otherwise, iterates over the Ingress's `status.loadBalancer.ingress`,
adding each non-empty `ip` and `hostname`.

In the case that `--resolve-ingress-target-hostname` set, it will resolve hostnames in the status to create
A/AAAA records instead of CNAME.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would say this is a feature request to the controller that creates the status field.

@n-marton
Copy link
Author

n-marton commented Apr 8, 2024

/unassign @Raffo

#4255 (comment) said use case is unclear, so I would say we do not accept this PR right now.

For me it's more a feature request to your ingress controller that can orchestrate external-dns as they wish.

even in the original PR #3554 that added the same functionality for Services types (and was also lgtm -ed by you), there was a discussion about doing the same for Ingresses in a second PR, that nobody followed up, if you are against this then could you please also leave a comment on that original PR that this feature is not encouraged anymore for ingresses, so no one else will waste time on it

@n-marton
Copy link
Author

One more usecase:

lets say you have an ingress object like this

NAME             CLASS    HOSTS                        ADDRESS        PORTS     AGE
hubble-ingress   <none>   hubble.example.com   10.10.10.100  80, 443   30d

if the loadbalancer backing the ingress controller next gets an fqdn instead of an IP and it will generate the following ingress

NAME             CLASS    HOSTS                        ADDRESS        PORTS     AGE
hubble-ingress   <none>   hubble.example.com   10-10-10-100.some.domain  80, 443   30d

in this case, external-dns will error you because hubble.example.com already exist as an A record so it would conflict with a CNAME it would like to create

@szuecs
Copy link
Contributor

szuecs commented Apr 25, 2024

One more usecase:

lets say you have an ingress object like this

NAME             CLASS    HOSTS                        ADDRESS        PORTS     AGE
hubble-ingress   <none>   hubble.example.com   10.10.10.100  80, 443   30d

if the loadbalancer backing the ingress controller next gets an fqdn instead of an IP and it will generate the following ingress

NAME             CLASS    HOSTS                        ADDRESS        PORTS     AGE
hubble-ingress   <none>   hubble.example.com   10-10-10-100.some.domain  80, 443   30d

in this case, external-dns will error you because hubble.example.com already exist as an A record so it would conflict with a CNAME it would like to create

That's what I said: it's a bug in the ingress controller.

@n-marton
Copy link
Author

n-marton commented Apr 26, 2024

One more usecase:
lets say you have an ingress object like this

NAME             CLASS    HOSTS                        ADDRESS        PORTS     AGE
hubble-ingress   <none>   hubble.example.com   10.10.10.100  80, 443   30d

if the loadbalancer backing the ingress controller next gets an fqdn instead of an IP and it will generate the following ingress

NAME             CLASS    HOSTS                        ADDRESS        PORTS     AGE
hubble-ingress   <none>   hubble.example.com   10-10-10-100.some.domain  80, 443   30d

in this case, external-dns will error you because hubble.example.com already exist as an A record so it would conflict with a CNAME it would like to create

That's what I said: it's a bug in the ingress controller.

One could argue that it is easier to solve it on external dns level, than get it into each ingress controller, just checking a few more popular ones:

However I get the feeling the this wont be ever merged as is, no matter the argument.

Just to stop more running in circles, I would be also fine using CNAMEs, if external-dns would be able to handle the transition between A and CNAME records, if I would make a PR about that feature, would that be suppoted?

@szuecs
Copy link
Contributor

szuecs commented May 10, 2024

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 10, 2024
@Tyrael
Copy link

Tyrael commented May 10, 2024

@szuecs could you please also answer to Marton so we can move this forward, one way or another? Thanks!

@daanvinken
Copy link

@szuecs Could you help us out here and/or elaborate whether allowing transition between A and CNAME is ok here?

Just to stop more running in circles, I would be also fine using CNAMEs, if external-dns would be able to handle the transition between A and CNAME records, if I would make a PR about that feature, would that be suppoted?

This is blocking a few things for us, please if we cannot proceed close this issue and let us know.

@k8s-triage-robot
Copy link

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-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 1, 2024
@n-marton
Copy link
Author

n-marton commented Sep 2, 2024

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 2, 2024
@k8s-triage-robot
Copy link

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-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants