Debugging Tip: Skip the Load Balancer
Assumptions
- You have a CF deployed
- You have one proxy app pushed and called appA
- You have one route mapped to appA called APP_A_ROUTE
- You have completed the previous stories in this track
What
In this story we are going to learn how to remove the LB (load balancer) from the data flow.
Here is simplified diagram of the data flow of an http route:
+----+ +----------+ +-------+ +-----+
| LB +--->+ Gorouter +-------->+ Envoy +---->+ App |
+----+ +----------+ +-------+ +-----+
When to do this:
- when you are having problems connecting to an app and you want to start picking off items one by one that are not the problem.
- when one particular gorouter is having problems and you want to send traffic to just that gorouter.
- when you are debugging and want to point your traffic at a particular gorouter so you can find the logs easier.
How
📝Send HTTP traffic using LB
- Curl the route for your app!
curl APP_A_ROUTE -v
- Save this output.
❓Do you see a host header on the request? How did that get there?
📝Send HTTP traffic without using LB
- Get the IP for your router VM.
- Send the traffic to the Gorouter IP and set the route in the host header:
curl GOROUTER_IP -H "Host: APP_A_ROUTE" -v
- Huh. That timed out and failed.
- Ssh onto any bosh VM and try again.
❓ Questions
- Why did it fail the first time and succeed when you were ssh-ed onto any bosh VM?
- How does the output for this curl differ from the one you did in the first section?
Expected Result
You were able to send traffic to a specific gorouter bypassing the LB.