gyptazy / ProxLB

ProxLB - (Re)Balance VM Workloads Across Nodes in Proxmox Clusters. A Load Balancer for Proxmox - and more!
https://proxlb.de
GNU General Public License v3.0
138 stars 6 forks source link

feature: Add rolling updates (node auto patching) feature #48

Open gyptazy opened 1 month ago

gyptazy commented 1 month ago

General

This PR adds the basic functionality to add a rolling update support for nodes in a cluster to ProxLB. If activated, nodes will:

This also brings up the new proxlb-additions package, which adds the missing options to the Proxmox API. This packages will be required. If this option is activated but the package is missing, ProxLB will throw an error guiding you to install the required package.

Test

Package updates present, but no reboot required:

root@virt01:~# /bin/proxlb -d -c /etc/proxlb/proxlb.conf
<6> ProxLB: Info: [logger]: Logger verbosity got updated to: INFO.
<4> ProxLB: Warning: [api-connection]: API connection does not verify SSL certificate.
<6> ProxLB: Info: [api-connection]: API connection succeeded to host: 127.0.0.1.
<6> ProxLB: Info: [node-update-status-getter]: Get update status for node: virt01.
<6> ProxLB: Info: [node-update-status-getter]: Updates available for node: virt01.
<6> ProxLB: Info: [node-update-executor]: Execute updates on node: virt01.
<6> ProxLB: Info: [node-update-executor]: Sucessfully integrated updates to node: virt01.
<6> ProxLB: Info: [node-reboot-status-getter]: Get reboot status for node: virt01.
<6> ProxLB: Info: [node-reboot-status-getter]: No reboot required for node: virt01.
<6> ProxLB: Info: [node-statistics]: Added node virt01.
<6> ProxLB: Info: [node-statistics]: Added node virt03.
<6> ProxLB: Info: [node-statistics]: Added node virt02.
<6> ProxLB: Info: [node-statistics]: Created node statistics.
<6> ProxLB: Info: [api-get-vm-tags]: Got VM/CT tag from API.
<6> ProxLB: Info: [api-get-vm-include-exclude-tags]: Got PLB include group.
[...]

Package updates present, reboot required:

add me

Activated but API addition missing:

Aug 10 14:35:41 virt03 proxlb[2543742]:  ProxLB: Info: [api-connection]: API connection succeeded to host: 127.0.0.1.
Aug 10 14:35:41 virt03 proxlb[2543742]:  ProxLB: Info: [cluster-master-getter]: Getting master node from cluster.
Aug 10 14:35:41 virt03 proxlb[2543742]:  ProxLB: Info: [cluster-master-getter]: Master node: virt03
Aug 10 14:35:41 virt03 proxlb[2543742]:  ProxLB: Info: [cluster-master-validator]: Node executor hostname is: virt03
Aug 10 14:35:41 virt03 proxlb[2543742]:  ProxLB: Info: [node-statistics]: Added node virt03.
Aug 10 14:35:41 virt03 proxlb[2543742]:  ProxLB: Info: [node-statistics]: Added node virt01.
Aug 10 14:35:41 virt03 proxlb[2543742]:  ProxLB: Info: [node-statistics]: Added node virt02.
Aug 10 14:35:41 virt03 proxlb[2543742]:  ProxLB: Info: [node-statistics]: Created node statistics.
Aug 10 14:35:41 virt03 proxlb[2543742]:  ProxLB: Info: [rolling-node-updates]: Performing rolling node updates. Rolling updates: True and ProxLB API: True
Aug 10 14:35:41 virt03 proxlb[2543742]:  ProxLB: Info: [node-update-status-getter]: Get update status for node: virt03.
Aug 10 14:35:41 virt03 pvedaemon[948]: update new package list: /var/lib/pve-manager/pkgupdates
Aug 10 14:35:44 virt03 proxlb[2543742]:  ProxLB: Info: [node-update-status-getter]: Updates available for node: virt03.
Aug 10 14:35:44 virt03 proxlb[2543742]:  ProxLB: Info: [node-update-executor]: Execute updates on node: virt03.
Aug 10 14:35:44 virt03 proxlb[2543742]:  ProxLB: Error: [node-update-executor]: Missing API endpoint on node: virt03. Please make sure to have the package proxlb-additions installed.

Notes

Fixes: #39 Fixes: #18