Retry failed TCP connections
Use MeshRetry to make more than one TCP connection attempt to a destination before giving up.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshRetry
metadata:
name: frontend-to-backend-tcp
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:
tcp:
maxConnectAttempt: 5Copied!
type: MeshRetry
name: frontend-to-backend-tcp
mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: frontend
to:
- targetRef:
kind: MeshService
labels:
kuma.io/display-name: backend
default:
tcp:
maxConnectAttempt: 5Copied!
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_tcp" {
provider = konnect-beta
type = "MeshRetry"
name = "frontend-to-backend-tcp"
spec = {
target_ref = {
kind = "Dataplane"
labels = {
app = "frontend"
}
}
to = [
{
target_ref = {
kind = "MeshService"
labels = {
"kuma.io/display-name" = "backend"
}
}
default = {
tcp = {
max_connect_attempt = 5
}
}
}
]
}
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!