stackitcloud / yawol

yawol is a Load Balancer solution for OpenStack, based on the Kubernetes controller pattern.
Apache License 2.0
41 stars 5 forks source link

Refine yawollet health check in keepailved #280

Closed maboehm closed 6 months ago

maboehm commented 6 months ago

Currently, the keepalived priority is influenced by a track_file which is supposed to represent that the LBM matches the latest revision. This allows for a rolling update, since all older instances will have a lower priority.

However, the track file is not always removed correctly, for example if the yawollet cannot reach the API-Server at all. So this change replaces the file-based check with a health endpoint, which is checked by keepalived via track_script. This now covers 3 conditions:

The last check is essentially a check if we can reach the API-Server. We could call the /healthz endpoint, but that might cause unnecessary load. By checking the conditions that the yawollet should be writing itself, we check both that we can write and read (watch) successfully from the API-Server without causing additional calls.