File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -1497,7 +1497,15 @@ function prepare-kube-proxy-manifest-variables {
1497
1497
params+=" --feature-gates=${FEATURE_GATES} "
1498
1498
fi
1499
1499
if [[ " ${KUBE_PROXY_MODE:- } " == " ipvs" ]]; then
1500
- sudo modprobe -a ip_vs ip_vs_rr ip_vs_wrr ip_vs_sh nf_conntrack_ipv4
1500
+ # use 'nf_conntrack' instead of 'nf_conntrack_ipv4' for linux kernel >= 4.19
1501
+ # https://github.com/kubernetes/kubernetes/pull/70398
1502
+ local -r kernel_version=$( uname -r | cut -d\. -f1,2)
1503
+ local conntrack_module=" nf_conntrack"
1504
+ if [[ $( printf " ${kernel_version} \n4.18\n" | sort -V | tail -1) == " 4.18" ]]; then
1505
+ conntrack_module=" nf_conntrack_ipv4"
1506
+ fi
1507
+
1508
+ sudo modprobe -a ip_vs ip_vs_rr ip_vs_wrr ip_vs_sh ${conntrack_module}
1501
1509
if [[ $? -eq 0 ]];
1502
1510
then
1503
1511
params+=" --proxy-mode=ipvs"
You can’t perform that action at this time.
0 commit comments