I have a POD running on node B (it is a small one so I just need a single instance of it running). My traefik controller is running on node A, my ingress is configured correctly according to treafik's documentation.
I've deployed a traefik controller on the node A too and did a port-forwarding to it to test. It worked fine giving me the idea that traefik controllers on the same node that my pods are respond correctly. I also noted that my deployment, service and ingress for this POD are all working fine. But for the traefik controller on node B the pod keeps answering Gateway Timeout. I ran into several docs and community questions/answers but I couldn't find a scenario like this one.
So, will I need to spread a ingress controller on all of my nodes and change my bare metal cluster DNS redirection rules anytime a POD changes it's location? Is there any configurations for traefik controllers to talk with each other and find where the right pod is?
Here's an example of the request flow, let's suppose I have a Jenkins pod, so I have this:
- jenkins-deployment.yaml (to deploy on any node)
- jenkins-service.yaml
- jenkins-ingress.yaml (with traefik annotations according to the documentation)
Scenario A: My Jenkins pod is running on the same node that my Traefik controller is running
request jenkins.my-local-cluster.io -> traefik controller listen to the request -> traefik controller tries to send the request to the Jenkins ingress -> 200
Scenario B: My Jenkins pod is running on nother node, different from the one that holds my Traefik controller is running
request jenkins.my-local-cluster.io -> traefik controller listen to the request -> traefik controller tries to send the request to the Jenkins ingress -> 504 Gateway Timeout