kube-proxy: Failed to load kernel module ip_vs with modprobe.

偶遇 kube-proxy ipvs 模式不能正常工作,报错如下:

W0301 09:14:39.492670       1 proxier.go:498] Failed to load kernel module ip_vs with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
W0301 09:14:39.493401       1 proxier.go:498] Failed to load kernel module ip_vs_rr with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
W0301 09:14:39.494103       1 proxier.go:498] Failed to load kernel module ip_vs_wrr with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
W0301 09:14:39.494841       1 proxier.go:498] Failed to load kernel module ip_vs_sh with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
W0301 09:14:39.500439       1 proxier.go:498] Failed to load kernel module ip_vs with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
W0301 09:14:39.501168       1 proxier.go:498] Failed to load kernel module ip_vs_rr with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
W0301 09:14:39.501883       1 proxier.go:498] Failed to load kernel module ip_vs_wrr with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules
W0301 09:14:39.502612       1 proxier.go:498] Failed to load kernel module ip_vs_sh with modprobe. You can ignore this message when kube-proxy is running inside container without mounting /lib/modules

这是由于 kube-proxy 容器没能自动挂载宿主机内核模块导致的。

可以手动在宿主机执行命令,挂载需要的内核模块:

[root@machine ~]# modprobe ip_vs
[root@machine ~]# modprobe ip_vs_rr
[root@machine ~]# modprobe ip_vs_wrr
[root@machine ~]# modprobe ip_vs_sh

然后,重启 kube-proxy,发现已经没有原来的警告,且工作在 ipvs 代理模式了

I0301 09:19:09.567473       1 server_others.go:176] Using ipvs Proxier.
W0301 09:19:09.567860       1 proxier.go:380] clusterCIDR not specified, unable to distinguish between internal and external traffic
W0301 09:19:09.567872       1 proxier.go:386] IPVS scheduler not specified, use rr by default
I0301 09:19:09.568520       1 server.go:562] Version: v1.14.2
I0301 09:19:09.580637       1 conntrack.go:52] Setting nf_conntrack_max to 131072
I0301 09:19:09.582465       1 config.go:102] Starting endpoints config controller
I0301 09:19:09.582487       1 controller_utils.go:1027] Waiting for caches to sync for endpoints config controller
I0301 09:19:09.582549       1 config.go:202] Starting service config controller
I0301 09:19:09.582557       1 controller_utils.go:1027] Waiting for caches to sync for service config controller
I0301 09:19:09.682604       1 controller_utils.go:1034] Caches are synced for service config controller
I0301 09:19:09.682604       1 controller_utils.go:1034] Caches are synced for endpoints config controller
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值