Skip to content

Commit

Permalink
Merge pull request #6853 from inverse-inc/feature/centralize-vip
Browse files Browse the repository at this point in the history
Allow to centralize the virtual IPs on the same server
  • Loading branch information
fdurand committed Jan 27, 2022
2 parents 9a30ae9 + c877828 commit 09f3a8f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
7 changes: 7 additions & 0 deletions conf/documentation.conf
Original file line number Diff line number Diff line change
Expand Up @@ -1558,6 +1558,13 @@ description=<<EOT
Defines the MariaDB password for Galera replication
EOT

[active_active.centralize_vips]
type=toggle
options=enabled|disabled
description=<<EOT
Centralize the virtual IP addresses on the same node instead of distributing them on the two first nodes of the cluster
EOT

[parking]
guide_anchor=_parked_devices

Expand Down
6 changes: 6 additions & 0 deletions conf/pf.conf.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,12 @@ galera_replication_username=
#
# Defines the replication password to be used for the MariaDB Galera cluster replication
galera_replication_password=
#
# active_active.centralize_vips
#
# Centralize the virtual IP addresses on the same node instead of distributing them on the two first nodes of the cluster
centralize_vips=disabled


[parking]
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
:text="$i18n.t('Set the gateway option in DHCP replies to point only to the VIP in cluster mode rather than to all servers in the cluster.')"
/>

<form-group-centralize-vips namespace="centralize_vips"
:column-label="$i18n.t('Centralized virtual IPs')"
:text="$i18n.t('Centralize the virtual IP addresses on the same node instead of distributing them on the two first nodes of the cluster.')"
/>

<form-group-centralized-deauth namespace="centralized_deauth"
:column-label="$i18n.t('Centralized access reevaluation')"
:text="$i18n.t('Centralize the deauthentication to the management node of the cluster.')"
Expand Down Expand Up @@ -75,6 +80,7 @@ import schemaFn from '../schema'
import {
FormGroupAuthOnManagement,
FormGroupCentralizedDeauth,
FormGroupCentralizeVips,
FormGroupConflictResolutionThreshold,
FormGroupDnsOnVipOnly,
FormGroupGatewayOnVipOnly,
Expand All @@ -92,6 +98,7 @@ const components = {
FormGroupAuthOnManagement,
FormGroupCentralizedDeauth,
FormGroupCentralizeVips,
FormGroupConflictResolutionThreshold,
FormGroupDnsOnVipOnly,
FormGroupGatewayOnVipOnly,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export {

BaseFormGroupToggleDisabledEnabled as FormGroupAuthOnManagement,
BaseFormGroupToggleDisabledEnabled as FormGroupCentralizedDeauth,
BaseFormGroupToggleDisabledEnabled as FormGroupCentralizeVips,
BaseFormGroupIntervalUnit as FormGroupConflictResolutionThreshold,
BaseFormGroupToggleDisabledEnabled as FormGroupDnsOnVipOnly,
BaseFormGroupToggleDisabledEnabled as FormGroupGatewayOnVipOnly,
Expand Down
6 changes: 4 additions & 2 deletions lib/pf/services/manager/keepalived.pm
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,13 @@ EOT
foreach my $interface ( @ints ) {
my $cfg = $Config{"interface $interface"};
next unless $cfg;
my $priority = 100 - pf::cluster::reg_cluster_index();
my $priority = 100 - pf::cluster::cluster_index();
if(isdisabled($Config{active_active}{centralize_vips})) {
$priority = 100 - pf::cluster::reg_cluster_index();
}
my $process_tracking = "haproxy_portal";
if ($Config{"interface $interface"}{'type'} =~ /management/i || $Config{"interface $interface"}{'type'} =~ /radius/i) {
$process_tracking = "radius_load_balancer";
$priority = 100 - pf::cluster::cluster_index();
}
my $cluster_ip = pf::cluster::cluster_ip($interface);
$tags{'vrrp'} .= <<"EOT";
Expand Down

0 comments on commit 09f3a8f

Please sign in to comment.