Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to centralize the virtual IPs on the same server #6853

Merged
merged 3 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -70,6 +75,7 @@ import schemaFn from '../schema'
import {
FormGroupAuthOnManagement,
FormGroupCentralizedDeauth,
FormGroupCentralizeVips,
FormGroupConflictResolutionThreshold,
FormGroupDnsOnVipOnly,
FormGroupGatewayOnVipOnly,
Expand All @@ -86,6 +92,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