Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Keepalived ignorant of systemd-networkd removing VIPs #836
Issue: When systemd is restarted (for example by an apt-get upgrade), systemd-networkd appears to remove the VIPs set up by keepalived. Keepalived does not notice this, and failover to the backup node does not happen. VIP is now down, and the service down.
Expected: When the managed IP address is removed on the system, keepalived should notice it and log it. Either try to restore it, or go into FAULT mode so that the backup node can take over.
Attempted workaround: Add functionality to check_script target that does "ip addr | grep " and fails if it isn't there.
I'm running keepalived 1.3.9 on Ubuntu 18.04 (bionic). This is a VRRP-only configuration, no ipvs.
This was reported to Debian about a year ago: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860151 . I was not able to find anything about it in any closed issues here.
As Alexender Wirt wrote at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860151#15, I think the fundamental issue here is that systemd-networkd is removing addresses that don't 'belong' to it (I wonder if it also removes ip routes and ip rules). However, I agree that keepalived should detect this situation and handle it appropriately.
The beta branch of keepalived does detect the removal of VIPs and will make the VRRP instance transition to backup mode (transitioning to FAULT mode would not work since there would never be an event for the VRRP instance to recover from fault mode). I will soon be adding to the beta code the detection and handling of ip routes and rules being deleted. See issue #534 for what I propose to implement; any feedback on the ideas there would be welcome.
Thanks for replying.
I've built the beta branch, and can confirm that it reconfigured the VIP when it was removed.
This is 8ecbb59 built with "autoreconf -vf && ./configure && make && make install DESTDIR=/opt/keepalived/" on ubuntu 18.04 bionic.
Method used for removing:
As far as I can tell, this solves my immediate problem. Thank you.