Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BackendRef weights not work #4602

Open
czczycz opened this issue Nov 1, 2024 · 1 comment
Open

BackendRef weights not work #4602

czczycz opened this issue Nov 1, 2024 · 1 comment
Labels

Comments

@czczycz
Copy link

czczycz commented Nov 1, 2024

I am testing the HttpRoute. I config BackendRefs with different weights(backend0 weight = 99 and backend1 weight = 1).

I sent thousands of requests and found that backend0 and backend1 received roughly the same number of requests.

I obtained the cluster configuration by admin API (/clusters?format=json). The clusters configuration shows that backend0 and backend1 have the same weight=1.

This is my httpRoute:

apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: myroute
  namespace: default
spec:
  hostnames:
  - example.com
  parentRefs:
  - group: gateway.networking.k8s.io
    kind: Gateway
    name: gw1
    namespace: default
    sectionName: http-80
  rules:
  - backendRefs:
    - group: gateway.envoyproxy.io
      kind: Backend
      name: backend0
      namespace:default
      port: 80
      weight: 99
    - group: gateway.envoyproxy.io
      kind: Backend
      name: backend1
      namespace: default
      port: 80
      weight: 1
    matches:
    - path:
        type: PathPrefix
        value: /

This is my clusters config:

"host_statuses": [
        {
            "address": {
                "socket_address": {
                    "address": "10.234.125.2",
                    "port_value": 80
                }
            },
            "stats": [],
            "health_status": {
                "eds_health_status": "HEALTHY"
            },
            "weight": 1,
            "locality": {
                "region": "httproute/default/myroute/rule/0/backend/0"
            }
        },
        {
            "address": {
                "socket_address": {
                    "address": "10.234.125.3",
                    "port_value": 80
                }
            },
            "stats": [],
            "health_status": {
                "eds_health_status": "HEALTHY"
            },
            "weight": 1,
            "locality": {
                "region": "httproute/default/myroute/rule/0/backend/1"
            }
        }
    ]
@czczycz czczycz added the triage label Nov 1, 2024
@czczycz czczycz changed the title BackendRef weight not work BackendRef weights not work Nov 1, 2024
@czczycz
Copy link
Author

czczycz commented Nov 1, 2024

It seems locality.LoadBalancingWeight doesn't work here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant