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

[CPDEV-96114] add keepalived globals and custom template support #578

Merged
merged 6 commits into from
Jan 16, 2024

Conversation

Imadzuma
Copy link
Contributor

@Imadzuma Imadzuma commented Dec 22, 2023

Description

Now it's not possible to provide additional parameters for keepalived configuration except vrrp_ips.
But in fact, user should sometimes specify some custom parameters related to their environment, e.g.: https://serverfault.com/questions/821809/keepalived-send-gratuitous-arp-periodically/822004#822004

Fixes # (issue)

Solution

  • Added new services.loadbalancer.keepalived.global section for global_defs keepalived parameters. Now following parameters are supported here:
    • vrrp_garp_master_refresh;
  • Modified keepalived config generation to support common parameters, not related to specific vrrp-ip;
  • Supported user specified config or config_file as for haproxy configuration;
  • Added documentation section with the list of parameters that are used for keepalived configuration;

Test Cases

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

TestCase 1: custom vrrp_garp_master_refresh value

Test Configuration:

  • Hardware:
  • OS:
  • Inventory: custom vrrp_garp_master_refresh (e.g. 10) specified;

Steps:

  1. Run kubemarine install;
  2. Run sudo tcpdump -i <interface> -nn arp on some node;

Results:

Before After
Installation task fails, if schema validation is enabled Successful installation
No global_defs section in /etc/keepalived/keepalived.conf on balancers global_defs section with vrrp_garp_master_refresh specified in /etc/keepalived/keepalived.conf on balancers
tcpdump handles garp requests only when vrrp ip changes the node tcpdump handles garp request for vrrp every 10 seconds (or other time, specified in vrrp_garp_master_refresh`)

TestCase 2: custom config value

Test Configuration:

  • Hardware:
  • OS:
  • Inventory: custom config specified for keepalived;

Steps:

  1. Run kubemarine install;

Results:

Before After
Installation task fails, if schema validation is enabled Successful installation
Default keepalived configuraiton /etc/keepalived/keepalived.conf on balancers custom configuration in /etc/keepalived/keepalived.conf on balancers

TestCase 3: custom config_file value

Test Configuration:

  • Hardware:
  • OS:
  • Inventory: custom config_file specified for keepalived;

Steps:

  1. Create custom keepalived template, based on default one. Add vrrp_garp_master_refresh_repeat parameter in global_def section with 5 value.
  2. Run kubemarine install;
  3. Run sudo tcpdump -i <interface> -nn arp on some node;

Results:

Before After
Installation task fails, if schema validation is enabled Successful installation
No vrrp_garp_master_refresh_repeat in /etc/keepalived/keepalived.conf on balancers custom vrrp_garp_master_refresh_repeat in /etc/keepalived/keepalived.conf on balancers
tcpdump handles garp requests only when vrrp ip changes the node tcpdump handles 5 garp requests for vrrp every 10 seconds (or other time, specified in vrrp_garp_master_refresh`)

TestCase 4: keep_config_updated=False case

Test Configuration:

  • Hardware:
  • OS:
  • Inventory: inentory with services.loadbalancer.keepalived.keep_config_updated=False property

Steps:

  1. Run kubemarine install --tasks prepare,deploy.loadbalancer;
  2. Check keepalived configuration;

Results:

Before After
Keepalived configured by kubemaine keepalived is not configured

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Integration CI passed
  • Unit tests. If Yes list of new/changed tests with brief description
  • There is no merge conflicts

Unit tests

Indicate new or changed unit tests and what they do, if any.

@OleksandrIaresko
Copy link
Collaborator

OleksandrIaresko commented Jan 9, 2024

QA Regression cases were tested/passed
Functional cases are in progress...

@koryaga koryaga self-assigned this Jan 10, 2024
@ilia1243 ilia1243 requested a review from shmo1218 January 11, 2024 07:36
@koryaga
Copy link
Contributor

koryaga commented Jan 15, 2024

@shmo1218 pls update

@koryaga koryaga merged commit 493b0bc into main Jan 16, 2024
36 checks passed
@koryaga koryaga deleted the CPDEV-96114_keepalived-customization branch January 16, 2024 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants