# ip route show default via 111.111.111.1 dev ens192 proto static metric 100 111.111.111.0/24 dev ens192 proto kernel scope link src 111.111.111.81 metric 100 172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:50:56:8c:5b:38 brd ff:ff:ff:ff:ff:ff inet 111.111.111.81/24 brd 111.111.111.255 scope global noprefixroute ens192 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:fe8c:5b38/64 scope link valid_lft forever preferred_lft forever 3: ens224: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:50:56:8c:1e:41 brd ff:ff:ff:ff:ff:ff
kubelet使用的IP地址
ip route show 命令中,可以知道机器的默认网卡,通常是 第一块网卡,如 default via 111.111.111.1 dev ens192
ip a 命令中,可显示默认网卡的 IP 地址,Kubernetes 将使用此 IP 地址与集群内的其他节点通信,如 111.111.111.81
所有节点上 Kubernetes 所使用的 IP 地址必须可以互通(无需 NAT 映射、无安全组或防火墙隔离)
${STATE} is MASTER for one and BACKUP for all other hosts, hence the virtual IP will initially be assigned to the MASTER.
${INTERFACE} is the network interface taking part in the negotiation of the virtual IP, e.g. eth0.
${ROUTER_ID} should be the same for all keepalived cluster hosts while unique amongst all clusters in the same subnet. Many distros pre-configure its value to 51.
${PRIORITY} should be higher on the master than on the backups. Hence 101 and 100 respectively will suffice.
${TRACK_INTERFACE} is a list of listening ports.
${AUTH_PASS} should be the same for all keepalived cluster hosts, e.g. 42
${APISERVER_VIP} is the virtual IP address negotiated between the keepalived cluster hosts.