In Dubbo Service Mesh, traffic management is implemented through the collaboration of the Dubbo control plane and the Dubbo Agent. The control plane generates gRPC xDS configuration based on Kubernetes CRDs and pushes it to Dubbo Agent via the xDS protocol, enabling fine-grained control over inter-service traffic.
The traffic management model of Dubbo Service Mesh is aligned with Istio, but optimized for the Dubbo protocol and sidecarless architecture. The core components are:
By configuring these resources, you can achieve traffic routing, load balancing, and resilience without modifying application code.
ServiceRoute is the core resource used to define routing rules in Dubbo Service Mesh, corresponding to Istio’s VirtualService. It allows you to configure how requests are routed to different versions or instances of a service.
ServiceRoute enables you to:
The following example shows how to configure a ServiceRoute to split traffic:
apiVersion: networking.dubbo.apache.org/v1
kind: ServiceRoute
metadata:
name: provider-weights
namespace: grpc-app
spec:
hosts:
- provider.grpc-app.svc.cluster.local
http:
- route:
- destination:
host: provider.grpc-app.svc.cluster.local
subset: v1
weight: 10
- destination:
host: provider.grpc-app.svc.cluster.local
subset: v2
weight: 90
The hosts field specifies the services that the ServiceRoute applies to. You can use either fully qualified domain names (FQDN) or short names. The control plane automatically resolves short names to FQDNs.
Routing rules define how requests are routed to target services. Each rule can contain:
When multiple ServiceRoutes match the same service, the control plane applies them in creation-time order. More specific match conditions take precedence over generic ones.
ServiceRoute supports more complex routing scenarios, including:
delegate field.SubsetRule is the resource used to define service subsets and traffic policies in Dubbo Service Mesh, corresponding to Istio’s DestinationRule. It allows you to organize service instances into logical subsets and configure traffic policies for each subset.
SubsetRule supports multiple load balancing strategies, configured via LocalityLbSetting in MeshConfig:
The following example shows how to create subsets and configure traffic policies:
apiVersion: networking.dubbo.apache.org/v1
kind: SubsetRule
metadata:
name: provider-versions
namespace: grpc-app
spec:
host: provider.grpc-app.svc.cluster.local
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
trafficPolicy:
loadBalancer:
simple: ROUND_ROBIN
tls:
mode: ISTIO_MUTUAL
Subsets are selected based on Pod labels. In the example above, Pods with label version: v1 are placed into subset v1, and Pods with version: v2 into subset v2.
Because Dubbo Service Mesh uses a sidecarless architecture, the traditional Sidecar resource is replaced by the Dubbo Agent. The Dubbo Agent is embedded into the application process and communicates with the control plane via the xDS protocol.