Hi, is it possible to make 2 Piholes running in a container with macvlan network on 2 different Raspberry PI5s high available (HA) with Keepalived?
I know it maybe sufficient to configure the 2 different Pihole IP addresses in the clients, but I was wondering is it possible to make these 2 Piholes high available via 1 virtual IP address.
The 2 Piholes are running ok in their containers.
- pihole01 ip address: 192.168.0.251
- pihole02 ip address: 192.168.0.252
- Intended virtual ip address: 192.168.0.250
The pihole container can be reached from the host they are running on. Without additional routing on the host this is not possible.
pihole02 is sync’ed with pihole01 using Nebula (containerized).
The Piholes are working fine. The cherry on the pudding would be to have this setup high available via Keepalived. Is this possible?
Due to the macvlan the pihole’s have their own IPs. As such running Keepalived on the host does not make sense (to my opinion) as that would not check the Pihole availability but the host availability. And as well, if the virtual IP would be assigned to the host, all other services (containers) would get that same virtual IP as well, while perhaps only the Pihole is down and non of the other containers.
Or is that a wrong assumption and is it possible to monitor the pihole containers with keepalived on host where the containers are running and somehow assign the virtual IP to one of the piholes?
I experimented a bit, by installing keepalived in a pihole container. Created a /etc/keepalived/keepalived.conf config file. And launched keepalived as follows: keepalived -n -l -D. That seems to do something:
Sun Sep 21 17:41:47 2025: (VI_1) removing VIPs.
Sun Sep 21 17:41:47 2025: Startup complete
Sun Sep 21 17:41:47 2025: Netlink: error: Operation not permitted(1), type=RTM_DELADDR(21), seq=1758469311, pid=0
Sun Sep 21 17:41:47 2025: (VI_1) Entering BACKUP STATE (init)
But I don't see the virtual IP 192.168.0.250 in the ip a output. Is keepalived not allowed to change the network configuration of the container?
If the above would be working, would it be possible to equipment the Pihole container with keepalived?
If the above will not work, would it be possible to use a keepalived container, and have keepalived 'monitor' the 2 piholes from remote and have the virtual IP address assigned to one of the 2 piholes?
Looking forward to what is possible with keepalived to make keepalived running in containers with macvlan high available.
Reference topic.
Thanks in advance