MoJo2600 / pihole-kubernetes

PiHole on kubernetes
498 stars 173 forks source link

Add the ability to specify arbitrary initContainers #211

Closed fernferret closed 1 year ago

fernferret commented 2 years ago

This is related to my other PR #210. What I was trying to (and did!) achieve was a much simpler ingress config while still leveraging TLS.

My Ingress is configured with traefik and most of the entries are served through... well Pi-hole DNS. If Pi-hole goes down then I won't be able to get to my DNS to manage it. So I wanted a memorabl IP (192.168.10.10) that I could use to expose via the built-in serviceWeb but still have lighttpd do the serving, to not introduce another sidecar/server. This is also how I had my non-kubernetes pihole configured.

That led me down a dark hole that led to a different issue in core pi-hole (a read-only issue with configmap mounting, when it tries to run touch external.conf).

Adding the ability to specify arbitrary initContainers can help people (like me!) who have non-standard configs without increasing the complexity of the overall helm chart.

In my case I used it to copy the external.conf file to an in-memory read-write mount, since configmaps cannot be made RW anymore (unless I missed something). With all of that said, arbitrary initContainers can be useful for a lot of things! I opted to call them extraInitContainers vs initContainers in case you decide that pihole-kubernetes needs some standard initContainers.

fernferret commented 2 years ago

Waiting on feedback from #210 on whether to bump the minor or bugfix semver.

fernferret commented 1 year ago

Hi @MoJo2600 I was doing my monthly merge and noticed that #260 got merged. While this is similar to this PR I think having the ability to have initContainers that perform pre-start conditions is still very useful for folks like me.

Is this PR able to be merged? If you have any requested changes I'm happy to make them. If you do not want to merge this, that's totally fine too, I'd just like to get it closed one way or another so it's not on my github open PRs anymore. Cheers!

MoJo2600 commented 1 year ago

I don't see why we should not add this ability if it helps. Thank you!