2016-12-05 39 views
0

我有一個主人和兩個人。Kubernetes:無法擊中主人的莢

Master IP: 192.168.20.50 
Menion1: 192.168.20.51 
Menion2: 192.168.20.52 

我能夠運行復制容器並在Master中創建服務。通過使用主IP訪問應用程序容器時遇到問題。

我沒有通過休閒命令將主從端口轉發給menion。

[[email protected] ~]# kubectl port-forward nginx :80 & 
[2] 2229 
[[email protected] ~]# I1201 22:15:46.822396 2229 portforward.go:213] Forwarding from 127.0.0.1:43020 -> 80 
I1201 22:15:46.822603 2229 portforward.go:213] Forwarding from [::1]:43020 -> 80 

所以,當我打本地主機與我可以訪問nginx的,但是當我擊中主IP我得到拒絕連接。

[[email protected] ~]# curl http://localhost:43020 
I1201 22:15:57.031858 2229 portforward.go:247] Handling connection for 43020 

<title>Welcome to nginx!</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> 
Welcome to nginx! 

如果看到此頁面,說明nginx web服務器已成功安裝並正常工作。需要進一步的配置。

有關在線文檔和支持請參考nginx.org。 nginx.com提供商業支持。

感謝您使用nginx。

[[email protected] ~]# curl http://192.168.1.49:43020 
curl: (7) Failed connect to 192.168.1.49:43020; Connection refused 
+0

達到吊艙您是否使用了特定的覆蓋網絡?你的機器是否可以IP轉發? –

回答

0

你轉發的波德流量端口80,你應該能夠在

192.168.1.49:80

192.168.1.49:43020

+0

雅我試過192.168.1.49:80。它也不工作。謝謝 – chandu

+0

我知道這不是你節點的IP。您是否嘗試過節點IP,而不是Pod IP? – MrE

+0

節點IP工作正常。不知道爲什麼當我做端口遠程教學時我無法打到Master – chandu