Fault Injection
To test microservices for resiliency, Istio allows us to inject delays and errors between services.
Let’s start the Lab.
Let’s create a VirtualService that creates 50% of 501 errors when the
details
service is called.apiVersion: networking.istio.io/v1alpha3kind: VirtualServicemetadata:name: detailsspec:hosts:- detailshttp:- fault:Run the following:
kubectl apply -f ./istio/samples/bookinfo/networking/fault-injection-details-v1.yaml> virtualservice.networking.istio.io/details created> destinationrule.networking.istio.io/details createdIn Kiali click on the productpage (orange) box and after a short while you should see 500 errors appearing. In the right side dtail panel you will see additional information about the problem in your communication between microservices.