How can I migrate Pi-hole from a single Deployment to a redundant StatefulSet?

0
0
Asked By MellowHarbor42 On

I'm running Pi-hole with Unbound on k3s. It currently runs as a single-replica Deployment, but I'd like to move to a three-replica StatefulSet so I can perform staged upgrades. What migration strategy would avoid database or configuration conflicts while preserving persistent data and keeping DNS available during rollouts?

2 Answers

Answered By QuietMarble5 On

Pi-hole is not especially well suited to active-active replication in Kubernetes. If you want independently scalable replicas with predictable rollouts, consider a more declarative DNS stack such as CoreDNS with Blocky. CoreDNS can load zones from Git or OCI, while Blocky can refresh blocklists from a defined source. Each pod can start from the same configuration without sharing a writable database, and a separate Redis-compatible cache can be used if shared caching is useful.

Answered By CedarFox8 On

You may not need a StatefulSet just to get rolling updates. A Deployment can run three replicas with a RollingUpdate strategy, for example with maxSurge set to 1 and maxUnavailable set to 1. That gradually replaces the pods. The important question is whether all replicas can safely use the same Pi-hole data and database.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.