2017-09-18 65 views
0

我正在从GCP迁移到Azure平台。我有一个k8s集群,需要使用内部IP与外部Cassandra集群进行通信,但在同一个Azure区域中,但是不同的VNET。我有VNET(s)窥视。我可以从K8s节点到达Cassandra集群,反之亦然,但无法从这些集群到达它们。K8s吊舱无法通过内部IP访问外部虚拟机

这似乎是一些Azure网络问题。我已经为豆荚打开了防火墙规则来达到卡桑德拉,但没有运气。我应该如何解决这个问题?

+0

@ 4c74356b41我正在使用IP地址。对困惑感到抱歉。我纠正了我的问题,与DNS无关。 – Segmented

回答

1

因为Azure无法找到您的pod的私有IP地址。我们可以使用Azure 路由表来连接它们。

这是我的测试,两个资源组,一个用于k8s,另一个用于信号VM。

这里是关于荚的信息:

enter image description here

关于信号VM的信息:

enter image description here

[email protected]:~# kubectl get pods --output=wide 
NAME      READY  STATUS RESTARTS AGE  IP    NODE 
influxdb     1/1  Running 0   59m  10.244.1.166 k8s-agent-ca9c4e39-0 
my-nginx-858393261-jrz15 1/1  Running 0   1h  10.244.1.63 k8s-agent-ca9c4e39-0 
my-nginx-858393261-wbpl6 1/1  Running 0   1h  10.244.1.62 k8s-agent-ca9c4e39-0 
nginx      1/1  Running 0   52m  10.244.1.179 k8s-agent-ca9c4e39-0 
nginx3      1/1  Running 0   43m  10.244.1.198 k8s-agent-ca9c4e39-0 

约K8S剂和主站的信息

By默认情况下,我们不能使用172.16.0.4来ping 10.244.1.0/24。我们应该添加一个Azure的路由表中,那么我们就可以ping该吊舱IP地址:

enter image description here

这里是我的结果:

[email protected]:~# ping 10.244.1.166 
PING 10.244.1.166 (10.244.1.166) 56(84) bytes of data. 
64 bytes from 10.244.1.166: icmp_seq=1 ttl=63 time=2.61 ms 
64 bytes from 10.244.1.166: icmp_seq=2 ttl=63 time=1.42 ms 
--- 10.244.1.166 ping statistics --- 
2 packets transmitted, 2 received, 0% packet loss, time 1001ms 
rtt min/avg/max/mdev = 1.424/2.019/2.614/0.595 ms 
[email protected]:~# ping 10.244.1.166 
PING 10.244.1.166 (10.244.1.166) 56(84) bytes of data. 
64 bytes from 10.244.1.166: icmp_seq=1 ttl=63 time=2.56 ms 
64 bytes from 10.244.1.166: icmp_seq=2 ttl=63 time=1.10 ms 
^C 
--- 10.244.1.166 ping statistics --- 
2 packets transmitted, 2 received, 0% packet loss, time 1001ms 
rtt min/avg/max/mdev = 1.102/1.833/2.564/0.731 ms 
[email protected]:~# ping 10.244.1.63 
PING 10.244.1.63 (10.244.1.63) 56(84) bytes of data. 
64 bytes from 10.244.1.63: icmp_seq=1 ttl=63 time=2.89 ms 
64 bytes from 10.244.1.63: icmp_seq=2 ttl=63 time=2.27 ms 
--- 10.244.1.63 ping statistics --- 
2 packets transmitted, 2 received, 0% packet loss, time 1001ms 
rtt min/avg/max/mdev = 2.271/2.581/2.892/0.314 ms 

关于Azure的路由表,请参阅本link

+0

感谢您的详细解释。这解决了我的问题 – Segmented

相关问题