docs: add EnvoyPatchPolicy cluster patching example - #9949
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1f3a8b275
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| kind: EnvoyPatchPolicy | ||
| metadata: | ||
| name: server-route-client-wrr | ||
| namespace: envoy-poc |
There was a problem hiding this comment.
Use resources created by the documented prerequisites
When a reader follows this page from the prerequisites, the quickstart creates the eg Gateway and backend HTTPRoute in default (examples/kubernetes/quickstart.yaml:8-17,72-91), but it never creates the envoy-poc namespace or server-route. Consequently this supposedly applicable example fails immediately because the namespace is absent, or cannot find the target cluster if the reader happens to have created that namespace. Reuse default/backend or add the missing namespace, Gateway, and HTTPRoute manifests.
Useful? React with 👍 / 👎.
| group: gateway.networking.k8s.io | ||
| kind: Gateway | ||
| name: eg | ||
| namespace: envoy-poc |
There was a problem hiding this comment.
Remove the unsupported targetRef namespace
EnvoyPatchPolicy.spec.targetRef is a LocalPolicyTargetReference, and the generated CRD permits only group, kind, and name under this field (charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_envoypatchpolicies.yaml:135-165). Thus namespace is rejected by strict field validation or pruned with a warning rather than selecting the target namespace; attachment is already scoped by the policy's own namespace. Remove this field from both copies of the example.
Useful? React with 👍 / 👎.
| cluster configuration with [egctl x translate][]: | ||
|
|
||
| ```shell | ||
| egctl x translate --from gateway-api -o yaml | yq '.clusters.dynamicActiveClusters[] | select(.cluster.name == "httproute/envoy-poc/server-route/rule/0")' |
There was a problem hiding this comment.
Provide the required input to the translate command
This verification command cannot execute as shown: egctl x translate --help defines --file/-f as required (also visible in internal/cmd/egctl/translate.go:92-113), while this invocation supplies neither a file nor stdin. Moreover, translated cluster output is nested below .xds.<config-key>.dynamicActiveClusters, not .clusters (internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.cluster.yaml:1-5). Supply the relevant Gateway API input and correct the query, or use egctl config envoy-proxy cluster to inspect the live patched proxy.
Useful? React with 👍 / 👎.
| | **Cluster name** | Old | `httproute/<HTTPRouteNamespace>/<HTTPRouteName>/rule/<RuleIndex>` | `default/backend/rule/0` | | ||
| | | V2 | `httproute/<HTTPRouteNamespace>/<HTTPRouteName>/rule/<RuleIndex>` | `default/backend/rule/0` | |
There was a problem hiding this comment.
Include the httproute prefix in cluster examples
The example contradicts the format in the same row: generated HTTPRoute cluster names include the leading httproute/ segment, as confirmed throughout the translation fixtures (for example internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.cluster.yaml:34). Readers copying default/backend/rule/0 will therefore target no xDS resource. Change both Old and V2 examples to httproute/default/backend/rule/0.
Useful? React with 👍 / 👎.
Document how to patch Cluster resources with EnvoyPatchPolicy, including cluster name format and a working load balancing policy example using replace instead of add. Fixes envoyproxy#7306 Signed-off-by: amarkdotdev <amark@g.jct.ac.il> Signed-off-by: Aaron <amark@g.jct.ac.il>
a1f3a8b to
1496eb6
Compare
Summary
httproute/<HTTPRouteNamespace>/<HTTPRouteName>/rule/<RuleIndex>replaceinstead ofaddforload_balancing_policysince clusters already have a default policyegctl x translateTest plan
Fixes #7306