diff --git a/site/content/en/v1.5/tasks/extensibility/envoy-patch-policy.md b/site/content/en/v1.5/tasks/extensibility/envoy-patch-policy.md index 72b047e3bc4..2522062b508 100644 --- a/site/content/en/v1.5/tasks/extensibility/envoy-patch-policy.md +++ b/site/content/en/v1.5/tasks/extensibility/envoy-patch-policy.md @@ -432,6 +432,153 @@ $ curl -v --header "Host: www.example.com" http://localhost:8888/ ... ``` +### Customize Cluster + +The following examples show how to use [EnvoyPatchPolicy][] to modify Envoy `Cluster` resources using JSONPatch semantics. + +{{< tabpane text=true >}} +{{% tab header="Add an external Cluster (from stdin)" %}} + +```shell +cat <//rule/ + # e.g. httproute/default/backend/rule/0 + name: httproute/default/backend/rule/0 + operation: + op: replace + path: "/connect_timeout" + value: "5s" +EOF +``` + +{{% /tab %}} +{{% tab header="Modify a route Cluster timeout (from file)" %}} +Save and apply the following resource to your cluster: + +```yaml +--- +apiVersion: gateway.envoyproxy.io/v1alpha1 +kind: EnvoyPatchPolicy +metadata: + name: tweak-route-cluster-timeout + namespace: default +spec: + targetRef: + group: gateway.networking.k8s.io + kind: Gateway + name: eg + type: JSONPatch + jsonPatches: + - type: "type.googleapis.com/envoy.config.cluster.v3.Cluster" + # For clusters generated from HTTPRoute, the default name is: + # httproute///rule/ + # e.g. httproute/default/backend/rule/0 + name: httproute/default/backend/rule/0 + operation: + op: replace + path: "/connect_timeout" + value: "5s" +``` + +{{% /tab %}} +{{< /tabpane >}} + ## Debugging ### Runtime