Skip to content

Weighted BackendRefs not showing expected outcome #2170

Closed
@ardikabs

Description

@ardikabs

Description:
I've got the intention to implement weighted backendRef for canary purposes.
Following through this documentation https://gateway.envoyproxy.io/latest/user/http-traffic-splitting/#weighted-backendrefs, didn't show an expected outcome for the weighted, it means given the weight ratio between services, such as backend A set the weight to 8, then backend B set the weight to 2, the result of Envoy Proxy config (both RDS and LDS) doesn't show the expected implementation, which should be 8:2 ratio.

Expectation:
The expectation is similar to the doc mentioned which is

The HTTPRoute below will configure the gateway to send 80% of the traffic to the backend service, and 20% to the backend-2 service.

Repro steps:
Assuming the backend services are ready as in backend and backend-2 with 1 replica.

Then apply below HTTPRoute

apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: http-headers
spec:
  parentRefs:
  - name: eg
  hostnames:
  - backends.example
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /
    backendRefs:
    - group: ""
      kind: Service
      name: backend
      port: 3000
      weight: 8
    - group: ""
      kind: Service
      name: backend-2
      port: 3000
      weight: 2

Note: If there are privacy concerns, sanitize the data prior to
sharing.

Environment:
Latest / v0.6.0

Logs:

  • RDS:
dynamicRouteConfigs:
- lastUpdated: "2023-11-09T15:14:02.825Z"
  routeConfig:
    '@type': type.googleapis.com/envoy.config.route.v3.RouteConfiguration
    ignorePortInHostMatching: true
    name: envoy-gateway-system/eg/http
    virtualHosts:
    - domains:
      - backends.example
      name: envoy-gateway-system/eg/http/backends_example
      routes:
      - match:
          prefix: /
        name: httproute/envoy-gateway-system/http-headers/rule/0/match/0/backends_example
        route:
          cluster: httproute/envoy-gateway-system/http-headers/rule/0
  versionInfo: c0ca1f138a0b4e661716ad9b97eae569732c3b77b83d93ca93dbdc7c25daa9a9
  • CDS:
dynamicActiveClusters:
- cluster:
    '@type': type.googleapis.com/envoy.config.cluster.v3.Cluster
    commonLbConfig:
      localityWeightedLbConfig: {}
    connectTimeout: 10s
    dnsLookupFamily: V4_ONLY
    edsClusterConfig:
      edsConfig:
        ads: {}
        resourceApiVersion: V3
      serviceName: httproute/envoy-gateway-system/http-headers/rule/0
    lbPolicy: LEAST_REQUEST
    name: httproute/envoy-gateway-system/http-headers/rule/0
    outlierDetection: {}
    perConnectionBufferLimitBytes: 32768
    type: EDS
  lastUpdated: "2023-11-09T14:01:30.025Z"
  versionInfo: a153eda209a91c54127227c8ecf047cbc4db498d0c54c6bc0c916cd793c1f9a3
  • EDS/CLA:
dynamicEndpointConfigs:
- endpointConfig:
    '@type': type.googleapis.com/envoy.config.endpoint.v3.ClusterLoadAssignment
    clusterName: httproute/envoy-gateway-system/http-headers/rule/0
    endpoints:
    - lbEndpoints:
      - endpoint:
          address:
            socketAddress:
              address: 10.252.0.57
              portValue: 3000
          healthCheckConfig: {}
        healthStatus: HEALTHY
        loadBalancingWeight: 1
      - endpoint:
          address:
            socketAddress:
              address: 10.252.0.20
              portValue: 3000
          healthCheckConfig: {}
        healthStatus: HEALTHY
        loadBalancingWeight: 1
      loadBalancingWeight: 2
      locality: {}
    policy:
      overprovisioningFactor: 140

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions