Retry gRPC calls on DeadlineExceeded
Use MeshRetry to retry gRPC calls from frontend to backend when the destination returns DeadlineExceeded.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshRetry
metadata:
name: frontend-to-backend-grpc
namespace: kong-mesh-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: frontend
to:
- targetRef:
kind: MeshService
labels:
kuma.io/display-name: backend
default:
grpc:
numRetries: 5
backOff:
baseInterval: 5s
maxInterval: 1m
retryOn:
- DeadlineExceededCopied!
type: MeshRetry
name: frontend-to-backend-grpc
mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: frontend
to:
- targetRef:
kind: MeshService
labels:
kuma.io/display-name: backend
default:
grpc:
numRetries: 5
backOff:
baseInterval: 5s
maxInterval: 1m
retryOn:
- DeadlineExceededCopied!
Adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_retry" "frontend_to_backend_grpc" {
provider = konnect-beta
type = "MeshRetry"
name = "frontend-to-backend-grpc"
spec = {
target_ref = {
kind = "Dataplane"
labels = {
app = "frontend"
}
}
to = [
{
target_ref = {
kind = "MeshService"
labels = {
"kuma.io/display-name" = "backend"
}
}
default = {
grpc = {
num_retries = 5
back_off = {
base_interval = "5s"
max_interval = "1m"
}
retry_on = [
"DeadlineExceeded"
]
}
}
}
]
}
labels = {
"kuma.io/mesh" = konnect_mesh.my_mesh.name
}
cp_id = konnect_mesh_control_plane.my_meshcontrolplane.id
mesh = konnect_mesh.my_mesh.name
}
Copied!