DestinationRule
is used to process the rules of the target address, and ServiceEntry
, WorkloadEntry
and other definitions related to DestinationRule
are consistent with open source
apiVersion: service.dubbo.apache.org/v1alpha1
kind: DestinationRule
metadata:
name: demo-route
spec:
host: demo
subsets:
trafficPolicy:
Field | Type | Description | Required |
---|---|---|---|
name | string | The name of the rule, easy to identify the purpose of the rule | YES |
host | string | The corresponding key value in the registry, now it is the interface name | YES |
trafficPolicy | TrafficPolicy | traffic policy | NO |
subsets | Subset[] | naming of single or multiple versions of the service | YES |
The name of the Subset
application service, which can be single or multiple versions
apiVersion: service.dubbo.apache.org/v1alpha1
kind: DestinationRule
metadata:
name: demo-route
spec:
subsets: #Subnet[]
- name:
labels:
Field | Type | Description | Required |
---|---|---|---|
name | string | service version name | YES |
labels | map<string, string> | labels on the service | YES |
TrafficPolicy
represents the load balancing policy
apiVersion: service.dubbo.apache.org/v1alpha1
kind: DestinationRule
metadata:
name: demo-route
spec:
trafficPolicy: #TrafficPolicy
loadBalancer:
Field | Type | Description | Required |
---|---|---|---|
loadBalancer | LoadBalancerSettings | Load Balancer Settings | YES |
LoadBalancerSettings
is used to represent the configuration related to load balancing
apiVersion: service.dubbo.apache.org/v1alpha1
kind: DestinationRule
metadata:
name: demo-route
spec:
trafficPolicy:
loadBalancer: #LoadBalancerSettings
simple:
consistentHash:
Field | Type | Description | Required |
---|---|---|---|
simple | string | load balancing strategy, including: ROUND_ROBIN , LEAST_CONN , RANDOM , PASSTHROUGH | YES |
consistentHash | ConsistentHashLB | Consistent Hash strategy (not implemented) NO | |
NO |