通过向服务调用注入延迟,可以测试服务通信不畅的后果。
- 注入延迟
virtualservice.networking.istio.io/nginx-default-v2 configured
root@istio1:~/ver# cat vs.yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: nginx-default-v2
namespace: version
spec:
hosts:
- "hello.lizhe.com"
gateways:
- nginx-gateway
http:
- route:
- destination:
host: nginx-service.version.svc.cluster.local
subset: v2
fault:
delay:
fixedDelay: 7s
percentage:
value: 100