How to make ingress connect to pod in my network

3/21/2019

my k8s master node has Public network IP, and worker node deploy in private net. worker node can connect to master but master cannot connect to worker node.

I have tested that can deploy a pod by kubectl, the pod running on worker node and master can watch pod status. but when I deploy a ingress, and access the ingress on master node, traffic cannot go to worker node.

I use flannel network.

I have tried use ssh tunnel, but it hard to management

I don't know if there are some suggests, thanks.

-- huangzhiran
kubernetes
kubernetes-ingress
networking

2 Answers

3/21/2019

All your nodes and master should have communication with each other, without this you are going to have problems on cluster functionalities.

The ingress creates a load balancer pointing to your nodes machines.

Why your master cannot connect to your nodes?

Give a check on: https://kubernetes.io/docs/concepts/architecture/master-node-communication/

-- Leandro Donizetti Soares
Source: StackOverflow

3/21/2019

If you are deployed in a cloud environment, the most likely cause is incorrect firewall settings or route configurations. However, ingress configuration errors also may appear to look like infrastructure problems at times.

The Ingress will redirect your requests to the different services that it is registered with. The endpoint health is also monitored and requests will only be sent to active and healthy endpoints. My troubleshooting flow is as follows:

  1. Hit an unregistered path on your url and check if you get the default backend response. If no, then your ingress controller may not be correctly set up (whether it be domain name, access rules, or just configuration). If yes, then your ingress controller should be correctly set up, and this is a problem with the Ingress definition or backend.

  2. Try hitting your registered path on your url. If you get a 504 gateway timeout, then your endpoint is accepting the request, but not responding correctly. You can follow the target pod logs to figure out whether it is behaving properly.

If you get a 503 Service Unavailable, then your service might be down or deemed unhealthy by the ingress. In this case, you should definitely verify that your pods are running properly.

  1. Check your nginx-ingress-controller logs to see how the requests are being redirected and what the internal responses are.
-- Frank Yucheng Gu
Source: StackOverflow