安装k8s缺少模块
报错信息如下:
[root@k8s-master-test ~]# sysctl -p /etc/sysctl.d/kubernetes.conf
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-iptables: No such fil e or directory
sysctl: cannot stat /proc/sys/net/bridge/bridge-nf-call-ip6tables: No such fi le or directory
net.ipv4.ip_forward = 1
net.ipv4.tcp_tw_recycle = 0
vm.swappiness = 0 # 禁止使用 swap 空间,只有当系统 OOM 时才允许使用它
vm.overcommit_memory = 1 # 不检查物理内存是否够用
vm.panic_on_oom = 0 # 开启 OOM
fs.inotify.max_user_instances = 8192
fs.inotify.max_user_watches = 1048576
fs.file-max = 52706963
fs.nr_open = 52706963
net.ipv6.conf.all.disable_ipv6 = 1
sysctl: cannot stat /proc/sys/net/netfilter/nf_conntrack_max: No such file or
解决方法:
[root@k8s-master-test modules]# cat > /etc/rc.sysinit << EOF
> #!/bin/bash
> for file in /etc/sysconfig/modules/*.modules ; do
> [ -x $file ] && $file
> done
> EOF
chmod 755 /etc/sysconfig/modules/br_netfilter.modules
lsmod |grep br_netfilter[root@k8s-master-test modules]# cat > /etc/sysconfig/ ules << EOFnetfilter.mod
> modprobe br_netfilter
> EOF
[root@k8s-master-test modules]# chmod 755 /etc/sysconfig/modules/br_netfilter .modules
[root@k8s-master-test modules]# lsmod |grep br_netfilter
br_netfilter 22256 0
bridge 151336 1 br_netfilter
[root@k8s-master-test modules]# modprobe ip_conntrack