我已按照以下链接说明在独立服务器上单独安装Kubernetes cluster
( one Master and one Worker- Node
) 。CentOS-8 OS
https://www.tecmint.com/install-a-kubernetes-cluster-on-centos-8/
Weave-Net - CNI plugin installed
按照上面的链接。现在我可以在我们的 K8s Master & Worker-Node 服务器中看到下面的新网络适配器。
weave: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1376
inet 10.32.0.1 netmask 255.240.0.0 broadcast 10.47.255.255
inet6 fe80::a07d:21ff:fef1:4656 prefixlen 64 scopeid 0x20<link>
ether a2:7d:21:f1:46:56 txqueuelen 1000 (Ethernet)
RX packets 141 bytes 13322 (13.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 48 bytes 4896 (4.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
但问题出在主机服务器无法ping (Or) access any of our remote site/location IPs
(下面给出 ping 响应)。而Local IPs are pinging & accessible
.
ping -c 4 120.121.5.48
PING 120.121.5.48 (120.121.5.48) 56(84) bytes of data.
From 10.32.0.1 icmp_seq=1 Destination Host Unreachable
From 10.32.0.1 icmp_seq=2 Destination Host Unreachable
From 10.32.0.1 icmp_seq=3 Destination Host Unreachable
From 10.32.0.1 icmp_seq=4 Destination Host Unreachable
--- 120.121.5.48 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 2999ms
pipe 4
同样从主机服务器尝试连接我们的远程LDAP server through telnet
它显示下面的错误消息。
# telnet 120.121.5.48 389
Trying 120.121.5.48...
telnet: connect to address 120.121.5.48: No route to host
在我们的K8s Master
& Worker-Node server
have 中23 network adapters
,Statically network IP
已经配置好了,那么需要为默认路由中可达的 K8s CNI 配置任何额外的配置吗?
ip route show
&route -n
输出如下。
# ip route show
default via 45.46.47.1 dev ens1f0 proto static metric 100
10.32.0.0/12 dev weave proto kernel scope link src 10.32.0.1
45.46.47.0/24 dev ens1f0 proto kernel scope link src 45.46.47.48 metric 100
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 45.46.47.1 0.0.0.0 UG 100 0 0 ens1f0
10.32.0.0 0.0.0.0 255.255.255.0 U 10 0 0 ens1f0
10.32.0.0 0.0.0.0 255.240.0.0 U 0 0 0 weave
45.46.47.0 0.0.0.0 255.255.255.0 U 100 0 0 ens1f0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
尝试使用以下命令将编织路线更改为默认值。它执行成功,但仍然是同样的问题。
ip route add 10.32.0.0/24 via 45.46.47.1 dev ens1f0 metric 100
假设如果我运行ifconfig weave down
一切正常。但要使用 Kubernetes 集群,我需要Weave-net network adapter
. 所以请帮我添加 IP 路由,以便我的 Kubernetes 集群地址通过适当的适配器,这样我就可以访问我们的本地和远程位置服务器。