Skip to content

Commit

Permalink
tweak readme
Browse files Browse the repository at this point in the history
  • Loading branch information
whalecold committed Aug 27, 2024
1 parent b8d3cc1 commit 75755ae
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
unit-benchmark-test:
strategy:
matrix:
go: [ "1.18", "1.19", "1.20", "1.21", "1.22", "1.23" ]
go: [ "1.18", "1.19", "1.20", "1.21", "1.22"]
os: [ X64 ]
runs-on: ${{ matrix.os }}
steps:
Expand Down
40 changes: 36 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,32 +276,64 @@ spec:

#### Retry

Support using VirtualService and EnvoyFilter to config retry policy, the EnvoyFilter has more configuration.

```
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
name: retry-sample
namespace: default
spec:
hosts:
- hello.prod.svc.cluster.local:21001
http:
- route:
- destination:
host: hello.prod.svc.cluster.local:21001
retries:
attempts: 1
perTryTimeout: 2s
```

```
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: retry-policy
name: retry-enhance
namespace: default
spec:
configPatches:
- applyTo: HTTP_ROUTE
match:
context: SIDECAR_OUTBOUND
routeConfiguration:
# service name, should obey FQDN
name: hello.default.svc.cluster.local:21001
vhost:
# service name, should obey FQDN
name: hello.default.svc.cluster.local:21001
patch:
operation: MERGE
value:
route:
retryPolicy:
numRetries: 5
numRetries: 3
perTryTimeout: 100ms
retryBackOff:
baseInterval: 100ms
maxInterval: 100ms
retriableHeaders:
- name: "kitexRetryErrorRate"
stringMatch:
exact: "0.29"
- name: "kitexRetryMethods"
stringMatch:
exact: "Echo,Greet"
workloadSelector:
labels:
# the label of the client pod.
# the label of the service pod.
app.kubernetes.io/name: kitex-client
```

## Example
Expand Down
40 changes: 36 additions & 4 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,32 +265,64 @@ spec:
```
#### 重试配置

重试支持两个配置方式:VirtualService 和 EnvoyFilter,EnvoyFilter 支持更丰富的重试策略。

```
apiVersion: networking.istio.io/v1
kind: VirtualService
metadata:
name: retry-sample
namespace: default
spec:
hosts:
- hello.prod.svc.cluster.local:21001
http:
- route:
- destination:
host: hello.prod.svc.cluster.local:21001
retries:
attempts: 1
perTryTimeout: 2s
```

```
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: retry-policy
name: retry-enhance
namespace: default
spec:
configPatches:
- applyTo: HTTP_ROUTE
match:
context: SIDECAR_OUTBOUND
routeConfiguration:
# service name, should obey FQDN
name: hello.default.svc.cluster.local:21001
vhost:
# service name, should obey FQDN
name: hello.default.svc.cluster.local:21001
patch:
operation: MERGE
value:
route:
retryPolicy:
numRetries: 5
numRetries: 3
perTryTimeout: 100ms
retryBackOff:
baseInterval: 100ms
maxInterval: 100ms
retriableHeaders:
- name: "kitexRetryErrorRate"
stringMatch:
exact: "0.29"
- name: "kitexRetryMethods"
stringMatch:
exact: "Echo,Greet"
workloadSelector:
labels:
# the label of the client pod.
# the label of the service pod.
app.kubernetes.io/name: kitex-client
```

## 示例
Expand Down

0 comments on commit 75755ae

Please sign in to comment.