Skip to content

Commit

Permalink
Doc Review relating to #596 (#603)
Browse files Browse the repository at this point in the history
* Doc Review relating to #596

* Update LoadBalancing.md
  • Loading branch information
shmo1218 authored Mar 20, 2024
1 parent b621a76 commit def51cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions documentation/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1063,8 +1063,8 @@ vrrp_ips:
#### maintenance type

Generally, the maintenance configuration is the same as the default configuration for balancer. The `maintenance_type` option allows to change the default behavior.
The following example discribes the type of traffic that applicable for particular IP
in [maintenance mode](/documentation/LoadBalancing.md#maintenance-mode) configuration. (`not bind` means that IP will not receive neither TCP nor HTTP traffic):
The following example describes the type of traffic that is applicable for a particular IP
in the [maintenance mode](/documentation/LoadBalancing.md#maintenance-mode) configuration. (`not bind` specifies that the IP receives neither TCP nor HTTP traffic):

```yaml
vrrp_ips:
Expand Down
32 changes: 16 additions & 16 deletions documentation/LoadBalancing.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ plugins:

Sometimes, it may be required to perform some maintenance operations on the cluster
during which external "business" traffic should be temporarily stopped,
while at the same time cluster API/UI should still be available for technical traffic (administrative tasks).
while at the same time the cluster API/UI should still be available for technical traffic (administrative tasks).
For example, such maintenance operations may be software updates or DR scenarios.

There are multiple ways to support such "maintenance mode".
Expand All @@ -156,43 +156,43 @@ Kubemarine supports maintenance mode on the level of HAProxy Load Balancer using
- Additional "technical" endpoint, which is served on separate vIP (e.g. `2.2.2.2`)

Both endpoints are served by the same HAProxy instances and route to the same backends (k8s API / ingress controller).
The business endpoint is used for business traffic, the technical endpoint is used for technical traffic.
Normally, both of these endpoints work, so any traffic is served.
The business endpoint is used for business traffic, and the technical endpoint is used for technical traffic.
Normally, both these endpoints work, so any traffic is served.
However, if maintenance mode should be enabled, HAProxy configuration could be changed,
so that business endpoint no longer forward traffic to backends, instead returning a HTTP error.
In this mode, only technical traffic will be served normally.
so that the business endpoint no longer forwards traffic to backends, instead returning an HTTP error.
In this mode, only the technical traffic is served normally.

### How to Use Maintenance Mode

To start using Maintenance Mode on KubeMarine cluster, it is required to do two things during cluster installation:
To start using Maintenance Mode on the Kubemarine cluster, it is required to do two things during the cluster installation:

1. Configure at least two vIP - one for business traffic and one for technical traffic.
Business vIP should be marked with [`params.maintenance-type: "not bind"`](/documentation/Installation.md#maintenance-type) to be "dropped" during maintenance mode.
Business vIP should be marked with [`params.maintenance-type: "not bind"`](/documentation/Installation.md#maintenance-type) to be "dropped" during the maintenance mode.

1. Maintenance Mode support should be enabled using [`haproxy.maintenance_mode: True`](/documentation/Installation.md#maintenance-mode).
This will not enable maintenance mode on HAProxy immediately, instead it will upload **additional** maintenance configuration on HAProxy nodes, which could be then used to enable maintenance mode.
This does not enable the maintenance mode on HAProxy immediately, instead it uploads **additional** maintenance configuration on HAProxy nodes, which could be then used to enable the maintenance mode.

After these steps, HAProxy nodes will support enabling maintenance mode.
After these steps, HAProxy nodes support enabling the maintenance mode.
To actually move HAProxy to maintenance mode, it is required to change HAProxy configuration from `haproxy.cfg` to `haproxy-mntc.cfg`.
To do this without conflicting with KubeMarine, use the following steps:
To do this without conflicting with Kubemarine, use the following steps:

1. Create HAProxy systemd drop-in directory, if not created already. For example, if haproxy service is named `haproxy.service`,
you will need to create directory `/etc/systemd/system/haproxy.service.d`.
1. In this directory, create file named `EnvFile` with the following content:
1. Create HAProxy systemd drop-in directory, if not created already. For example, if the HAProxy service is named `haproxy.service`,
you need to create the `/etc/systemd/system/haproxy.service.d` directory.
1. In this directory, create a file named `EnvFile` with the following content:

```csv
CONFIG=/etc/haproxy/haproxy-mntc.cfg
```
1. In the same directory, create file named `select.conf` with path to `EnvFile` created above:
1. In the same directory, create a file named `select.conf` with the path to `EnvFile` created above:
```csv
[Service]
EnvironmentFile=/etc/systemd/system/haproxy.service.d/EnvFile
```
1. Restart HAProxy service using command `sudo systemctl daemon-reload; sudo systemctl restart haproxy`
1. To disable maintenance mode, change `EnvFile` content to use default configuration and restart haproxy again:
1. Restart the HAProxy service using the command `sudo systemctl daemon-reload; sudo systemctl restart haproxy`
1. To disable maintenance mode, change `EnvFile` content to use the default configuration and restart HAProxy again:
```csv
CONFIG=/etc/haproxy/haproxy.cfg
Expand Down

0 comments on commit def51cc

Please sign in to comment.