前两天新配置了几台虚拟机,像往常一样安装集群,但是在flannel这一步总是有问题,查看日志:
Failed to find any valid interface to use: failed to get default interface: Unable to find default route
没找到有效的网卡设备,解决办法也很简单,在flannel的启动参数中指定网卡即可:
--iface="": interface to use (IP or name) for inter-host communication. Defaults to the interface for the default route on the machine. This can be specified multiple times to check each option in order. Returns the first match found.
--iface-regex="": regex expression to match the first interface to use (IP or name) for inter-host communication. If unspecified, will default to the interface for the default route on the machine. This can be specified multiple times to check each regex in order. Returns the first match found. This option is superseded by the iface option and will only be used if nothing matches any option specified in the iface options.
指定网卡参数可以指定确定的网卡名称,也可以使用正则表达式匹配,而我做的是一个通用的部署脚本