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

Pi-Hole Local DNS Support

Open tinyzimmer opened this issue 2 years ago • 22 comments

Description

~~Marking this WIP primarily until I get some feedback on design decisions I likely made poorly 😄, but also it needs tests and documentation.~~

~~Still need tests, but this is mostly ready.~~

This adds support for synchronizing DNS records with a Pi-Hole Local DNS instance. I've only put it through limited testing so far locally, so if there are others who want to try it out too to help catch edge cases that would be super helpful, but probably not an immediate priority.

I'm happy to help maintain this provider, but I can't make a guarantee on

It would be nice if the maintainers run the provider in production

Mainly, because I think I'd rather go sky diving out of a low-flying Cessna before attempting to actually do that. BUT! I am more than happy to continue to run this in my homelab if it continues to prove itself useful.

Addresses #1930

Checklist

  • [x] Unit tests updated
  • [x] End user documentation updated

tinyzimmer avatar Sep 24 '21 22:09 tinyzimmer

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

:memo: 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.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

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 avatar Sep 24 '21 22:09 k8s-ci-robot

Welcome @tinyzimmer!

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 24 '21 22:09 k8s-ci-robot

/assign @njuettner

tinyzimmer avatar Sep 28 '21 09:09 tinyzimmer

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tinyzimmer To complete the pull request process, please ask for approval from njuettner after the PR has been reviewed.

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 Sep 29 '21 10:09 k8s-ci-robot

I know this would never see production usage, but I do feel it serves as a good training piece for people running homelabs. I've been running it about a week in mine, and the combination of calico BGP with this makes for a pretty slick flat network across the house with automatic DNS resolution.

I gotta say, as ugly as the client code is, it works pretty well.

tinyzimmer avatar Sep 30 '21 09:09 tinyzimmer

I strongly agree this would be great option for home usage. Just come up to this PR while searching something just like this. I'll give it a try with your fork, thank you for the effort! @tinyzimmer

mehmettaskiner avatar Sep 30 '21 09:09 mehmettaskiner

@mehmettaskiner Awesome! Thanks for the kind words.

Feel free to ping me here if you run into any issues.

tinyzimmer avatar Sep 30 '21 09:09 tinyzimmer

I don't do that usually, but I notify this PR is very interesting and I can't wait to see it released in external-dns. ❤️

davinkevin avatar Nov 20 '21 10:11 davinkevin

CLA Signed

The committers are authorized under a signed CLA.

  • :white_check_mark: Avi Zimmerman (fe6ba6631e86d65af7d1c18c58148ecc744b3118, 09546a397bb0d712297db89c8f1679d31506d685, 446aba11741c5371aee630b7434037621cf41676, 0e3f111450037ceb858d898b63fc8731cab37d40, c777f999ba70e6f73ad827ef1291591b6051fe91, db482a023c0f9f5ea8a39d5f9a1552dcb8492ced, 93d77917cec9c0b1473a6f40be4e97b4ffd66b2c, 9ada990cfd0ecb2eb142c4b173a5dcdfaf6e3ab4, 8ddcfa3884250c1824f420e7201c6f7309acad70, 6d49a1e0522f752a7bba0dc0cfc616285ba66368, b95d7da9af9c13c801ae69b52a3dc559ab71af8c, e74fded1683fd7167c5e69080f9267bc9f8f0502, e7f2d2fa4127ee28d90eb262302fff52442837a8, 0f3f7948308e75f80272b47c425ba5a696ea5b60, e988c292c67c98471b7c8f8b3e54d5fbae42e50e)

Any update on a potential review and/or merge?

tinyzimmer avatar Jan 27 '22 10:01 tinyzimmer

When will this pr merge?

linuxmall avatar Jan 27 '22 19:01 linuxmall

Hey there @tinyzimmer - Thank you for this! I am testing it out in my homelab, working perfectly so far. It is very useful for me. I am using it along with metalLB. Looking forward to seeing it in an external-dns release.

pdmurray avatar Feb 02 '22 18:02 pdmurray

@tinyzimmer and @pdmurray How can i test? I would like to run on my home

linuxmall avatar Feb 02 '22 20:02 linuxmall

@tinyzimmer and @pdmurray How can i test? I would like to run on my home

You'll need to clone and checkout the branch on my fork. Then you can use the Makefile to build a container image.

tinyzimmer avatar Feb 02 '22 21:02 tinyzimmer

@tinyzimmer and @pdmurray How can i test? I would like to run on my home

You'll need to clone and checkout the branch on my fork. Then you can use the Makefile to build a container image.

@linuxmall also check out the guide that @tinyzimmer wrote.

In my case I did exactly as @tinyzimmer suggested, I cloned his fork, built the Docker image and pushed it to my GCR registry and then followed his instructions. Just edit the K8S deployment template to point to your Docker image and you should be good to go!

pdmurray avatar Feb 03 '22 18:02 pdmurray

Just wondering where this is at?

pdebuitlear avatar Mar 14 '22 23:03 pdebuitlear

@tinyzimmer: 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 avatar Mar 21 '22 18:03 k8s-ci-robot

Any chance this work (for nonproprietary, arm oriented solution) could be merged as it would greatly facilitate homelab & student environments setup ?

adlnc avatar Jun 12 '22 18:06 adlnc

I can confirm this is working perfectly on my homelab. I cloned tinyzimmer's fork, built an image locally using docker build . --build-arg ARCH=amd64 -t registry.local/kubernetes-sigs/external-dns:pihole-support, pushed this image to my homelab (registry.local) registry. Finally I deployed the currently released external-dns helm chart (1.9.0) using the deployment values:

image:
  repository: registry.local/kubernetes-sigs/external-dns
  tag: pihole-support
  pullPolicy: Always
policy: upsert-only
triggerLoopOnEvent: true
domainFilters:
- {{ .Values.urlSuffix }}
provider: pihole
registry: noop
env:
- name: EXTERNAL_DNS_PIHOLE_SERVER
  value: {{ .Values.pihole.url }}
- name: EXTERNAL_DNS_PIHOLE_PASSWORD
  value: {{ .Values.pihole.password }}
serviceMonitor:
  enabled: true

Hope this helps someone. :)

rupertbenbrook avatar Jul 01 '22 09:07 rupertbenbrook

Please @tinyzimmer, can you provide a rebase for this? I'm dying to see it merged and release!

davinkevin avatar Jul 21 '22 18:07 davinkevin

@davinkevin It would be the second rebase I've done and at this point I'm kinda curious for an acknowledgment that it has merge potential first.

tinyzimmer avatar Jul 25 '22 10:07 tinyzimmer

@davinkevin It would be the second rebase I've done and at this point I'm kinda curious for an acknowledgment that it has merge potential first.

Fair enough! So @njuettner and @seanmalloy are the only one able to validate this here. Again, this is a very awaited feature 😇

davinkevin avatar Jul 26 '22 05:07 davinkevin

@njuettner and @seanmalloy waiting for your final review please ! :)

@tinyzimmer you might need anothe rebase :(

anubisg1 avatar Oct 07 '22 19:10 anubisg1

Sorry that we are having that kind of backlog. I already read it a while ago and I would merge it like it is in case rebase was done.

szuecs avatar Oct 08 '22 17:10 szuecs

@tinyzimmer any chance you could rebase this? it would be finally merged!

anubisg1 avatar Oct 31 '22 21:10 anubisg1

Sorry that we are having that kind of backlog. I already read it a while ago and I would merge it like it is in case rebase was done.

@szuecs

i went ahead and rebased this with https://github.com/kubernetes-sigs/external-dns/pull/3125

if approved and merged, then this PR would be obsolete and could be closed

I made no changes, only rebased the few lines that needed to be moved around.

anubisg1 avatar Oct 31 '22 22:10 anubisg1

This was merged via https://github.com/kubernetes-sigs/external-dns/pull/3125 and i think that this specific one can be closed

anubisg1 avatar Nov 10 '22 08:11 anubisg1

/close

szuecs avatar Nov 10 '22 09:11 szuecs

@szuecs: Closed this PR.

In response to this:

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

k8s-ci-robot avatar Nov 10 '22 09:11 k8s-ci-robot