Load nf_conntrack module if nf_conntrack_ipv4 failed (#3764)

pull/3889/head
Egor 2018-12-12 16:33:54 +03:00 committed by Kubernetes Prow Robot
parent 5e84dabb46
commit dc8a8011be
1 changed files with 20 additions and 1 deletions

View File

@ -100,11 +100,26 @@
- ip_vs_rr - ip_vs_rr
- ip_vs_wrr - ip_vs_wrr
- ip_vs_sh - ip_vs_sh
- nf_conntrack_ipv4
when: kube_proxy_mode == 'ipvs' when: kube_proxy_mode == 'ipvs'
tags: tags:
- kube-proxy - kube-proxy
- name: Modprobe nf_conntrack_ipv4 for kernels < 4.19
modprobe:
name: nf_conntrack_ipv4
state: present
register: enable_nf_conntrack
ignore_errors: yes
when: kube_proxy_mode == 'ipvs'
- name: Modprobe nf_conntrack for kernels >= 4.19
modprobe:
name: nf_conntrack
state: present
when:
- enable_nf_conntrack is failed
- kube_proxy_mode == 'ipvs'
- 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
@ -113,7 +128,11 @@
ip_vs_rr ip_vs_rr
ip_vs_wrr ip_vs_wrr
ip_vs_sh ip_vs_sh
{% if enable_nf_conntrack is failed -%}
nf_conntrack
{%- else -%}
nf_conntrack_ipv4 nf_conntrack_ipv4
{%- endif -%}
when: kube_proxy_mode == 'ipvs' when: kube_proxy_mode == 'ipvs'
tags: tags:
- kube-proxy - kube-proxy