故障注入
延迟实验
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: ratings
spec:
hosts:
- ratings
http:
- match:
- headers:
end-user:
exact: jason
fault:
delay:
percentage:
value: 100.0
fixedDelay: 7s
route:
- destination:
host: ratings
subset: v1
- route:
- destination:
host: ratings
subset: v1
http终止错误
[root@k8s-master01 networking]# kubectl apply -f virtual-service-ratings-test-abort.yaml -n istio
virtualservice.networking.istio.io/ratings configured
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: ratings
spec:
hosts:
- ratings
http:
- match:
- headers:
end-user:
exact: jason
fault:
abort:
percentage:
value: 100.0
httpStatus: 500
route:
- destination:
host: ratings
subset: v1
- route:
- destination:
host: ratings
subset: v1
posted on 2023-05-16 15:33 FLOWERS_WAN 阅读(10) 评论(0) 编辑 收藏 举报