Warning: Array to string conversion in /home/wwwroot/myf5/wp-content/plugins/wpjam-basic/public/wpjam-utils.php on line 496
超时控制
$ kubectl apply -f - <<EOF
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews
http:
- route:
- destination:
host: reviews
subset: v2
timeout: 0.5s 《《《《《《
EOF
对应的envoy配置
"route": {
"cluster": "outbound|9080|v2|reviews.istio-bookinfo.svc.cluster.local",
"timeout": "0.500s", 《《《《《《《《《!!!!
"retryPolicy": {
"retryOn": "connect-failure,refused-stream,unavailable,cancelled,retriable-status-codes",
"numRetries": 2,
"retryHostPredicate": [
{
"name": "envoy.retry_host_predicates.previous_hosts"
}
],
"hostSelectionRetryMaxAttempts": "5",
"retriableStatusCodes": [
503
]
},
"maxGrpcTimeout": "0.500s"
},
延迟控制设置策略
$ kubectl apply -f - <<EOF
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: ratings
spec:
hosts:
- ratings
http:
- fault:
delay:
percent: 100
fixedDelay: 2s
route:
- destination:
host: ratings
subset: v1
EOF
对应的envoy配置
"typedPerFilterConfig": {
"envoy.fault": {
"@type": "type.googleapis.com/envoy.config.filter.http.fault.v2.HTTPFault",
"delay": {
"fixedDelay": "1s",
"percentage": {
"numerator": 50
}
}
}
Array
文章评论