Browse Source

Create variables for ipvs kernel modules (#10580)

* Create variables for ipvs kernel modules

* Corrected kubernetes role node task missing name

* Added changes as suggested during review by VannTen
pull/10606/head
borgiacis 1 year ago
committed by GitHub
parent
commit
802da0bcb0
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 13 deletions
  1. 8
      roles/kubernetes/node/defaults/main.yml
  2. 22
      roles/kubernetes/node/tasks/main.yml

8
roles/kubernetes/node/defaults/main.yml

@ -240,3 +240,11 @@ azure_cloud: AzurePublicCloud
# - TLS_RSA_WITH_AES_256_CBC_SHA
# - TLS_RSA_WITH_AES_256_GCM_SHA384
# - TLS_RSA_WITH_RC4_128_SHA
kube_proxy_ipvs_modules:
- ip_vs
- ip_vs_rr
- ip_vs_wrr
- ip_vs_sh
- ip_vs_wlc
- ip_vs_lc

22
roles/kubernetes/node/tasks/main.yml

@ -112,11 +112,7 @@
community.general.modprobe:
name: "{{ item }}"
state: present
with_items:
- ip_vs
- ip_vs_rr
- ip_vs_wrr
- ip_vs_sh
loop: "{{ kube_proxy_ipvs_modules }}"
when: kube_proxy_mode == 'ipvs'
tags:
- kube-proxy
@ -132,18 +128,18 @@
tags:
- kube-proxy
- name: Add nf_conntrack_ipv4 kube-proxy ipvs module list
set_fact:
kube_proxy_ipvs_modules: "{{ kube_proxy_ipvs_modules + ['nf_conntrack_ipv4'] }}"
when: modprobe_nf_conntrack_ipv4 is success
tags:
- kube-proxy
- name: Persist ip_vs modules
copy:
dest: /etc/modules-load.d/kube_proxy-ipvs.conf
mode: 0644
content: |
ip_vs
ip_vs_rr
ip_vs_wrr
ip_vs_sh
{% if modprobe_nf_conntrack_ipv4 is success -%}
nf_conntrack_ipv4
{%- endif -%}
content: "{{ kube_proxy_ipvs_modules | join('\n') }}"
when: kube_proxy_mode == 'ipvs'
tags:
- kube-proxy

Loading…
Cancel
Save