Skip to content

Conversation

hjoshi123
Copy link
Contributor

What does it do ?

Adds external-dns.alpha.kubernetes.io/gateway-hostname-source annotation to the GatewayAPI source.

Motivation

#5391

More

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. source labels May 31, 2025
@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 May 31, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @hjoshi123. 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 k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 31, 2025
@ivankatliarchuk
Copy link
Contributor

/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 Jun 1, 2025
@mloiseleur
Copy link
Collaborator

At first glance, it makes sense.
@abursavich Wdyt ? Anything I missed ? Do you think you can review this PR ?

@mloiseleur mloiseleur changed the title feat(source): added gateway api hostname source annotation feat(source): add gateway api hostname source annotation Jun 1, 2025
@bdrewery
Copy link

bdrewery commented Jun 4, 2025

I ran into a case of needing this too.
Probably should update docs/annotations/annotations.md or docs/sources/gateway-api.md or any doc.

@ivankatliarchuk
Copy link
Contributor

Hi @bdrewery,

Would you be able to share an abstract with a use case for that annotation? This would be incredibly helpful for our documentation; it's always valuable to provide not just the feature itself, but also practical examples of how it can be used.

@ivankatliarchuk
Copy link
Contributor

I think there is a great explanation about one of the use cases, we could re-use and add it to docs #5391 (comment)

Customers need to be able to resolve most of their traffic over the private endpoint, so they set up DNS for company.private.example.com to point to their internal VPC endpoint. The CNAME then directs traffic from company.public.example.com to company.private.example.com which resolves privately to their internal endpoint. This is then directed to our Gateway API private load balancer, then routed in-cluster.

Some limited traffic from third-party services that our customers use (namely SCIM) cannot traverse this private endpoint, so we need to have that traffic be able to resolve company.private.example.com to our public gateway instead. Inside their network, that will still resolve to their internal endpoint, but those third-party services will be able to send traffic to the public endpoint (which will only handle traffic for a \scim endpoint and blackhole everything else).

The problem is that the hostname those third-party services will have to use is company.public.example.com, so that's the hostname that we need to use on our HTTPRoute. We don't want to override our CNAME however, or that will break our customers other operations. We want external DNS to create ONLY an A record for company.private.example.com -> public gateway loadbalancer DNS, but the default behavior is to add both the hostname annotations and the hostname defined in the HTTPRoute spec, which causes it to override our ExernalName service's CNAME record with a message like this:

@hjoshi123
Copy link
Contributor Author

@ivankatliarchuk yes I was gonna modify the documentation for ingress since the annotation's purpose is similar

@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 ivankatliarchuk for approval. 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

@hjoshi123
Copy link
Contributor Author

@bdrewery @ivankatliarchuk added documentation.. let me know if the documentation works

@ivankatliarchuk
Copy link
Contributor

/ok-to-test

@ivankatliarchuk
Copy link
Contributor

In docs use-cases missing. And would you be able to share evidences that the code is working and make changes expected?

@hjoshi123
Copy link
Contributor Author

Hmm.. @ivankatliarchuk I will try running it on my homelab over the weekend.. if someone can do it earlier then it would be better too.. the unit tests are passing though
also I think I did add the use-cases in docs/sources under why is this needed?

@mloiseleur
Copy link
Collaborator

/ok-to-test

@ivankatliarchuk
Copy link
Contributor

Example use cases for another annotation https://github.com/kubernetes-sigs/external-dns/blob/master/docs/advanced/ttl.md#use-cases-for-external-dnsalphakubernetesiottl-annotation. This will help us and a community to decide which annotation to use

@hjoshi123
Copy link
Contributor Author

Ah gotcha @ivankatliarchuk I can add it.. although I didn't get time to run this on a cluster.. but seems like the tests are passing.. I am not sure if any of you guys have bandwidth to try it out

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 9, 2025
@k8s-ci-robot
Copy link
Contributor

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.

@KalenWessel
Copy link

Checking in to see when this functionality will be merged in? I'm currently running into a similar scenario outlined in this comment

@ivankatliarchuk
Copy link
Contributor

This PR abandoned. If anyone interested to add feature what is required;

Example result #5828 (comment)

If needed, see how to test a PR. This will require golang to be installed.

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. docs needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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. source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants