Pre-check
- [x] I am sure that all the content I provide is in English.
Search before asking
- [x] I had searched in the issues and found no similar issues.
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
Dubbo:3.3.2 JDK: 21 k8s: 1.23.6
Steps to reproduce this issue
dubbo3 registered to k8s, set the weights of v1 and v2 provider, but the consumer call provider has no effect
What you expected to happen
Both dubbo consumer and provider have been registered in k8s, VirtualService and DestinationRule have been added to the provider for weighting, the yaml of the provider in k8s is as follows, provider yaml
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: k8s-provider-rule
spec:
host: k8s-provider-svc
trafficPolicy:
loadBalancer:
simple: ROUND_ROBIN
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: k8s-provider-vs
namespace: dubbo-app
spec:
hosts:
- k8s-provider-svc
tcp:
- route:
- destination:
host: k8s-provider-svc
subset: v1
weight: 9999
- destination:
host: k8s-provider-svc
subset: v2
weight: 1
consumer yaml
apiVersion: v1
kind: Service
metadata:
name: k8s-consumer-svc
namespace: dubbo-app
spec:
type: ClusterIP
sessionAffinity: None
selector:
app: k8s-consumer
ports:
- protocol: TCP
port: 8811
targetPort: 8811
name: tcp
- name: grpc-tri
protocol: TCP
port: 50052
targetPort: 50052
the consumer code
··· @DubboReference(version = "1.0.0", retries = 0, providedBy = "k8s-provider-svc", timeout=5000, providerPort = 50052, check = false, cluster="failsafe", protocol = "tri",mock = "org.example.k8s.api.service.mock.ApiOrderMock") ApiOrder apiOrder; ···
Anything else
No response
Are you willing to submit a pull request to fix on your own?
- [ ] Yes I am willing to submit a pull request on my own!
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Comment From: tom055
Consumer tries to add loadbalance = “roundrobin” but it still affects Istio weights
@DubboReference(version = "1.0.0",
retries = 0,
providedBy = "k8s-provider-svc",
timeout=5000,
providerPort = 50052,
loadbalance = "roundrobin",
check = false,
cluster="failsafe",
protocol = "tri",mock = "org.example.k8s.api.service.mock.ApiOrderMock")
ApiOrder apiOrder;
Comment From: zrlw
check the lastest dubbo codes because PRs was not backported to 3.2 anymore.