Once we have traffic coming into our cluster through the Istio ingress gateway (covered in chapter 4), we can manipulate the traffic at the request level and control exactly where to route the request. In the previous chapter, we covered traffic control for weighted routing, request-match-based routing, and certain types of release patterns that can then be enabled. We can also use this traffic control to route around problems in the event of application errors, network partitions, and other major issues.
The problem with distributed systems is that they often fail in unpredictable ways, and we cannot manually take traffic-shifting actions. We need a way to build sensible behaviors into the application so they can respond on their own when they encounter problems. We can do that with Istio, including adding timeouts, retries, and circuit breaking, without having to alter application code. In this chapter, we look at how to do this and the implications for the rest of the system.