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

WIP: Add new external-dns addon for exposing Ingress, LoadBalancer & Istio external IPs to the host #13333

Closed

Conversation

denniseffing
Copy link

@denniseffing denniseffing commented Jan 12, 2022

Hi!

I created a new and refined version iterated over the initial draft in #9000. Special thanks to @segevfiner for figuring out the biggest issues! Made my PR a whole lot easier.

This addon deploys a bind named DNS server and an ExternalDNS instance. ExternalDNS observes Ingress, Service, Istio Gateway and VirtualService resources and configures the DNS server accordingly. The DNS zone can be configured using minikube addons configure external-dns and is set to demo. by default. This means that by default, you can only configure hostnames ending in .demo.

The DNS server is exposed to the host network and shall be used as DNS resolver for the host machine.
This way, ingresses and services of type LoadBalancer are resolvable by the host.

I also added a handbook page for the addon based on the handbook page of the ingress-dns addon. Since both addons utilize DNS servers, the instructions are quite the same and shamelessly reused, if still applicable. Please let me know if that is okay.

I included examples as well. Please let me know if you run into any issues. Thanks!

How to test with provided example

$ ./out/minikube start

$ ./out/minikube addons enable ingress

$ ./out/minikube addons enable external-dns

$ kubectl apply -f deploy/addons/external-dns/example/example.yaml

Add the minikube ip as a DNS server as shown here: https://minikube.sigs.k8s.io/docs/handbook/addons/ingress-dns/

$ curl http://hello-john.demo

Hello, world!
Version: 1.0.0
Hostname: hello-world-app-86d5b6469f-wndph

$ curl http://hello-jane.demo

Hello, world!
Version: 1.0.0
Hostname: hello-world-app-86d5b6469f-wndph

TODO

  • Ingress Hostnames currently resolve to localhost instead of the minikube IP because the ingress addon starts the nginx ingress-controller using the argument --publish-status-address=localhost. We should consider removing the argument from the ingress addon. I'm not quite sure why the argument is needed in the first place, everything works perfectly without the argument
  • The internal CoreDNS server should forward to the bind DNS server for the configured DNS zone to allow resolving hostnames internally as well. Steps on how to achieve this manually is already documented on the ingress-dns handbook and external-dns handbook page but I think it would be the best experience, if we could automate this using the external-dns plugin. I don't really know how to patch existing deployments using minikube addons though, so some pointers on how to achieve this would be much appreciated!
  • The ExternalDNS pod goes into a CrashLoopBackoff when the Istio CRDs are not installed on the cluster. This seems to be an issue with ExternalDNS itself, see The external-dns pod crashes when no CRD objects are present for a particular source kubernetes-sigs/external-dns#2490. I guess I will work around this issue by introducing a configurable setting for Istio support. This setting can be removed in the future when ExternalDNS fixed the issue.

Fixes #8980

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 12, 2022
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 12, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jan 12, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @denniseffing!

It looks like this is your first PR to kubernetes/minikube 🎉. 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/minikube 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 Jan 12, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @denniseffing. Thanks for your PR.

I'm waiting for a kubernetes 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 12, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: denniseffing
To complete the pull request process, please assign sharifelgamal after the PR has been reviewed.
You can assign the PR to them by writing /assign @sharifelgamal in a comment when ready.

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

@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@denniseffing
Copy link
Author

denniseffing commented Jan 13, 2022

I am currently ironing out the details regarding signing the CLA as codecentric employee. I expect that I can finally sign the CLA sometime next week.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 1, 2022
@RA489
Copy link

RA489 commented Mar 4, 2022

/check-cla
/easycla

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 22, 2022
The addon deploys externaldns and bind.
externaldns configures DNS records in bind using RFC2136 based on Ingresses, Services, Istio Gateways and Istio VirtualServices.

bind is exposed on the host network so that the host can use bind as a DNS server to resolve the hostnames.

Signed-off-by: Dennis Effing <dennis.effing@codecentric.de>
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 22, 2022
DNS zone can be configured using `minikube addon configure external-dns`.

Signed-off-by: Dennis Effing <dennis.effing@codecentric.de>
Signed-off-by: Dennis Effing <dennis.effing@codecentric.de>
Signed-off-by: Dennis Effing <dennis.effing@codecentric.de>
ExternalDNS pod goes into a CrashLoopBackoff when ExternalDNS is
configured to watch Istio resources and Istio CRDs are not installed.
To work around this issue, Istio CRD support is now configurable and
disabled by default.

Signed-off-by: Dennis Effing <dennis.effing@codecentric.de>
@denniseffing
Copy link
Author

denniseffing commented Apr 22, 2022

I rebased the branch, signed the CLA and fixed another bug with the custom DNS zone configuration.
The issue due to the --publish-status-address=localhost parameter of the nginx ingress controller configured by the ingress addon has been resolved with commit 2be6b99.

I still need some help regarding the CoreDNS configuration of the k8s cluster itself. Is modifying the CoreDNS ConfigMap and restarting the pod even possible with minikube addons?

A review and feedback by admins or someone else would be much appreciated! @RA489 Maybe you could help? 🙂

@k8s-ci-robot
Copy link
Contributor

@denniseffing: 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 17, 2022
@k8s-triage-robot
Copy link

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

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

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or 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 Aug 15, 2022
@RA489
Copy link

RA489 commented Aug 15, 2022

/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 Aug 15, 2022
@k8s-triage-robot
Copy link

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

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

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or 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 Nov 13, 2022
@k8s-triage-robot
Copy link

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

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

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

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

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 13, 2022
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and 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:

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

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

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and 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:

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

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

/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/test-infra repository.

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/work-in-progress Indicates that a PR should not merge because it is a work in progress. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add addon for external DNS
5 participants