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 2023-11-08 12:44:02 +01:00 committed by GitHub
parent 6305dd39e9
commit 802da0bcb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 13 deletions

View File

@ -240,3 +240,11 @@ azure_cloud: AzurePublicCloud
# - TLS_RSA_WITH_AES_256_CBC_SHA # - TLS_RSA_WITH_AES_256_CBC_SHA
# - TLS_RSA_WITH_AES_256_GCM_SHA384 # - TLS_RSA_WITH_AES_256_GCM_SHA384
# - TLS_RSA_WITH_RC4_128_SHA # - 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

View File

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