envoyproxy / envoyproxy/gateway

How to patch Cluster with EnvoyPatchPolicy

Open
#7,306 4 comments 0 reactions 1 assignee Claimed by @thiagomedina View on GitHub
documentation
Dominant language
Go
Stars
3k
Forks
864
Avg merge
2d 2h
Merged PRs (30d)
140

Description

*Description*:
An example would be nice to determine how to modify cluster config in EnvoyPatchPolicy

```
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: eg
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: eg
namespace: envoy-poc
spec:
gatewayClassName: eg
listeners:
- name: http
port: 80
protocol: HTTP
allowedRoutes:
namespaces:
from: Same
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: server-route
namespace: envoy-poc
spec:
parentRefs:
- name: eg
rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: server
port: 8080
---
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyPatchPolicy
metadata:
name: server-route-client-wrr
namespace: envoy-poc
spec:
type: JSONPatch
targetRef:
group: gateway.networking.k8s.io
kind: GatewayClass
name: eg
jsonPatches:
- type: type.googleapis.com/envoy.config.cluster.v3.Cluster
name: httproute/envoy-poc/server-route/rule/0
operation:
op: add
path: /load_balancing_policy
value:
policies:
- typed_extension_config:
name: envoy.load_balancing_policies.client_side_weighted_round_robin
typed_config:
"@type": type.googleapis.com/envoy.extensions.load_balancing_policies.client_side_weighted_round_robin.v3.ClientSideWeightedRoundRobin
```

I am doing the following but the patch is not working

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.