Skip to content

How to patch Cluster with EnvoyPatchPolicy #7306

Description

@altaiezior

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

Activity

  1. added
    documentation
    good first issue
    help wanted
    and removed on Oct 22, 2025
  2. altaiezior commented on Oct 22, 2025

    @altaiezior
    ContributorAuthor

    Hey thanks for the quick reply, can you help me suggest what I am doing wrong in the above config. Also how do I use the cluster name here?

  3. adity-a34 commented on Oct 22, 2025

    @adity-a34
    Contributor

    Hi @arkodg
    I would like to work on this, as I can learn more through it.
    Please assign it to me.

    Thank you.

  4. thiagomedina commented on Sep 5, 2026

    @thiagomedina
    Contributor
  5. removed
    good first issue
    help wanted
    on Sep 7, 2026
  6. added a commit that references this issue on Sep 18, 2026
    155adf6
  7. added a commit that references this issue on Nov 2, 2026
    4255dc3
  8. added a commit that references this issue on Nov 6, 2026
    02e9f89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions