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

Adding-IPVS-option #190

Merged
merged 4 commits into from
Feb 8, 2024
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ rke2_kubevip_image: ghcr.io/kube-vip/kube-vip:v0.6.4
# Specify which image is used for kube-vip cloud provider container
rke2_kubevip_cloud_provider_image: ghcr.io/kube-vip/kube-vip-cloud-provider:v0.0.4

# Enable kube-vip IPVS load balancer for control plane
rke2_kubevip_ipvs_lb_enable: false
# Enable layer 4 load balancing for control plane using IPVS kernel module
# Must use kube-vip version 0.4.0 or later

# (Optional) A list of kube-vip flags
# All flags can be found here https://kube-vip.io/docs/installation/flags/
# rke2_kubevip_args: []
Expand Down
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ rke2_kubevip_image: ghcr.io/kube-vip/kube-vip:v0.6.4
# Specify which image is used for kube-vip cloud provider container
rke2_kubevip_cloud_provider_image: ghcr.io/kube-vip/kube-vip-cloud-provider:v0.0.4

# Enable kube-vip IPVS load balancer for control plane
rke2_kubevip_ipvs_lb_enable: false
# Enable layer 4 load balancing for control plane using IPVS kernel module
# Must use kube-vip version 0.4.0 or later


# (Optional) A list of kube-vip flags
# All flags can be found here https://kube-vip.io/docs/installation/flags/
# rke2_kubevip_args: []
Expand Down
13 changes: 13 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@
when:
- rke2_ha_mode | bool

- name: Enable IPVS kernel module
community.general.modprobe:
name: ip_vs
state: present
persistent: present
when:
- rke2_kubevip_ipvs_lb_enable | bool
- inventory_hostname in groups[rke2_servers_group_name]
- rke2_ha_mode | bool
- rke2_ha_mode_kubevip | bool
- not rke2_ha_mode_keepalived | bool


- name: Copy kube-vip manifests to the masternode
ansible.builtin.include_tasks: kubevip.yml
when:
Expand Down
2 changes: 2 additions & 0 deletions templates/kube-vip/kube-vip.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
value: "{{ rke2_api_ip }}"
- name: prometheus_server
value: :2112
- name: lb_enable
value: "{{ rke2_kubevip_ipvs_lb_enable }}"
{% if rke2_kubevip_args is defined %}
{% for item in rke2_kubevip_args %}
- name: {{ item.param }}
Expand Down
Loading