From 6646eb121ee0978c4a7b1c7c681d8eb09a37e93c Mon Sep 17 00:00:00 2001 From: MaverickD650 <92877124+MaverickD650@users.noreply.github.com> Date: Sun, 18 May 2025 16:28:50 +0100 Subject: [PATCH] feat(external dns): Support for PiHole V6 (#35450) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** Support for PiHole V6 has been added in the latest External DNS release. Made some changes to account for the new api flag and requisite changes to the docs. ⚒️ Fixes # **⚙️ Type of change** - [x] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code - [ ] 📜 Documentation Changes **🧪 How Has This Been Tested?** Tested the new External DNS chart with PiHole in my own cluster by adding the api version flag as an env variable and verified it is working as intended. Made the changes in this PR to bring the flag into line with the rest of the PiHole related config. **📃 Notes:** **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [X] 📄 I have made changes to the documentation - [X] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [X] ⬆️ I increased versions for any altered app according to semantic versioning - [X] I made sure the title starts with `feat(chart-name):`, `fix(chart-name):`, `chore(chart-name):`, `docs(chart-name):` or `fix(docs):` **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --------- Signed-off-by: MaverickD650 <92877124+MaverickD650@users.noreply.github.com> Co-authored-by: Kjeld Schouten --- charts/stable/external-dns/Chart.yaml | 2 +- charts/stable/external-dns/docs/setup-guide.md | 16 +++++++++------- charts/stable/external-dns/templates/_args.tpl | 3 +++ charts/stable/external-dns/values.yaml | 1 + 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/charts/stable/external-dns/Chart.yaml b/charts/stable/external-dns/Chart.yaml index 795d24653f1..1996070a198 100644 --- a/charts/stable/external-dns/Chart.yaml +++ b/charts/stable/external-dns/Chart.yaml @@ -36,5 +36,5 @@ sources: - https://github.com/kubernetes-sigs/external-dns - https://github.com/truecharts/charts/tree/master/charts/stable/external-dns type: application -version: 6.8.0 +version: 6.9.0 diff --git a/charts/stable/external-dns/docs/setup-guide.md b/charts/stable/external-dns/docs/setup-guide.md index 89096532583..1cf233ff283 100644 --- a/charts/stable/external-dns/docs/setup-guide.md +++ b/charts/stable/external-dns/docs/setup-guide.md @@ -71,19 +71,20 @@ If this works, you'll see DNS entries inside Cloudflare's DNS page. ### PiHole -:::danger[Temporally broken] - -Because of API changes in Pi-hole v6 this is temporally broken. -More info: https://github.com/kubernetes-sigs/external-dns/issues/5113 - -::: - #### Step 1 - Set `pihole` as provider - set sources `ingress` and `service` should covers everything - Recommend using `noop` for `registry` - Set PiHole Server Address `piholeServer` and PiHole Server Password `piholePassword` +- Set `piholeAPIVersion` depending on which version of PiHole you have installed i.e. 5 or 6 + +:::caution[Future deprecation] + +The option for version 5 of the PiHole api will be deprecated in a future External DNS release. +More info: https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/pihole.md + +::: ```yaml externaldns: @@ -100,6 +101,7 @@ More info: https://github.com/kubernetes-sigs/external-dns/issues/5113 policy: "upsert-only" # would prevent ExternalDNS from deleting any records, omit to enable full synchronization piholeServer: "http://pihole.pihole.svc.cluster.local:8089" piholePassword: "DitIsSuperGeheim" + piholeAPIVersion: "6" ``` #### Step 2 diff --git a/charts/stable/external-dns/templates/_args.tpl b/charts/stable/external-dns/templates/_args.tpl index b6e7f0453cf..d79a3918729 100644 --- a/charts/stable/external-dns/templates/_args.tpl +++ b/charts/stable/external-dns/templates/_args.tpl @@ -45,4 +45,7 @@ args: {{- with .Values.externaldns.piholePassword }} - --pihole-password={{ . }} {{- end -}} + {{- with .Values.externaldns.piholeAPIVersion }} + - --pihole-api-version={{ . }} + {{- end -}} {{- end -}} diff --git a/charts/stable/external-dns/values.yaml b/charts/stable/external-dns/values.yaml index dcd3d6b8f46..6ad85961adc 100644 --- a/charts/stable/external-dns/values.yaml +++ b/charts/stable/external-dns/values.yaml @@ -17,6 +17,7 @@ externaldns: policy: "" piholeServer: "" piholePassword: "" + piholeAPIVersion: "" triggerLoopOnEvent: "false" txtOwnerId: "" txtPrefix: ""