Netcracker/KubeMarine

Implement procedure to switch haproxy mode

Opened this issue · 2 comments

It is necessary to implement maintenance procedure which switches haproxy mode. See maintenance mode and maintenance type.

Also, during cluster installation over an existing cluster, the mode should be reverted to default (not maintenance).

The high level proposal is described https://github.com/Netcracker/KubeMarine/pull/435/files/fc4536ea4ab1ab45cebed5b937888b9ad7d67dc4#r1197530570

Maintenace mode support for haproxy load balancer is already present in current code.

With maintenance_mode: True in haproxy properties in services and maintenance-type: "not bind" paramter in vrrp properties, we can set the haproxy in maintenance mode.

We need a mechanism for setting the maintenace mode on/off on haproxy.

We have a draft plan to create a new procedure named as "haproxy_mntc.py" and working on creating this procedure which will enable/disable maintenance mode on HAProxy.

This procedure will do the following-

  1. Check if maintenance mode is supported by the cluster be checking presence of below parameter
loadbalancer:
    haproxy:
      maintenance_mode: True

If above mentioned parameter is missing, exit the procudure with error msg.

  1. Do the config chnages required to enable/disable maintenance mode
  2. Perform daemon reload and service restart for haproxy

Usage of this new procedure will be like 

kubemarine haproxy_mntc enable/disable