rancher安装过程中,一直在报错导致安装失败:
Not using `--random-fully` in the MASQUERADE rule for iptables because the local version of iptables does not support it
原因是默认的iptables版本为v1.6.0不能被支持导致的,解决方法就是升级iptable是的版本,可以通过执行如下命令:
docker run -it rancher/hyperkube:v1.16.2-k8s1
在出现的命令行中,再执行
cat > /etc/apt/sources.list << EOF
deb https://mirrors.ustc.edu.cn/debian/ stretch main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ stretch main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ stretch-updates main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ stretch-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debian/ stretch-backports main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ stretch-backports main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free
EOF
apt-get update
apt remove --purge iptables && \
apt autoremove -y && \
clean-install libip4tc0=1.6.2-1.1~bpo9+1 \
libip6tc0=1.6.2-1.1~bpo9+1 \
libiptc0=1.6.2-1.1~bpo9+1 \
libxtables12=1.6.2-1.1~bpo9+1 \
iptables=1.6.2-1.1~bpo9+1
将iptables的版本升级到1.6.2
此时,再启动一个新的终端界面执行:
[root@node1 ~]# docker ps|grep hyper
aec0112233 rancher/hyperkube:v1.16.2-k8s1 "/bin/sh"
于是执行docker commit将修改后的容器导出成镜像,并覆盖之前的镜像:
docker commit aec0112233 rancher/hyperkube:v1.16.2-k8s1
重新开始安装worker结点的流程即可