I have one Master and 2 Menions.
Master IP: 192.168.20.50
Menion1: 192.168.20.51
Menion2: 192.168.20.52
I am able to run replication containers and create Services in Master. I have a problem in accessing Application container by using Master IP.
I did port forwarding from master to menion with fallowing command.
[root@master ~]# kubectl port-forward nginx :80 &
[2] 2229
[root@master ~]# 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
So when I hit with localhost I can access nginx but when I hit with Master IP I am getting connection refused.
[root@master ~]# 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!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org. Commercial support is available at nginx.com.
Thank you for using nginx.
[root@master ~]# curl http://192.168.1.49:43020
curl: (7) Failed connect to 192.168.1.49:43020; Connection refused
You forwarded the Pod traffic to port 80
, you should be able to reach the pod at
192.168.1.49:80
not
192.168.1.49:43020