W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
目標(biāo)地址規(guī)則
DestinationRule用來處理目標(biāo)地址的規(guī)則,與DestinationRule相關(guān)的ServiceEntry, WorkloadEntry等定義與開源保持一致
apiVersion: service.dubbo.apache.org/v1alpha1 kind: DestinationRule metadata: name: demo-route spec: host: demo subsets: trafficPolicy:
Field | Type | Description | Required |
---|---|---|---|
name | string | 規(guī)則的名字,方便識別規(guī)則用意 | YES |
host | string | 注冊中心里面對應(yīng)的key值,現(xiàn)在是接口名 | YES |
trafficPolicy | TrafficPolicy | 流量策略 | NO |
subsets | Subset[] | 服務(wù)的單一版本或多版本的命名 | YES |
Subset應(yīng)用服務(wù)的命名,可以是單個也可以是多個版本
apiVersion: service.dubbo.apache.org/v1alpha1 kind: DestinationRule metadata: name: demo-route spec: subsets: #Subnet[] - name: labels:
Field | Type | Description | Required |
---|---|---|---|
name | string | 服務(wù)版本名稱 | YES |
labels | map<string, string> | 打在服務(wù)身上的標(biāo)簽 | YES |
TrafficPolicy表示負(fù)載均衡策略
apiVersion: service.dubbo.apache.org/v1alpha1 kind: DestinationRule metadata: name: demo-route spec: trafficPolicy: #TrafficPolicy loadBalancer:
Field | Type | Description | Required |
---|---|---|---|
loadBalancer | LoadBalancerSettings | 負(fù)載均衡設(shè)置 | YES |
LoadBalancerSettings用來表示負(fù)載均衡相關(guān)的配置
apiVersion: service.dubbo.apache.org/v1alpha1 kind: DestinationRule metadata: name: demo-route spec: trafficPolicy: loadBalancer: #LoadBalancerSettings simple: consistentHash:
Field | Type | Description | Required |
---|---|---|---|
simple | string | 負(fù)載均衡策略,其中包括:ROUND_ROBIN, LEAST_CONN, RANDOM, PASSTHROUGH | YES |
consistentHash | ConsistentHashLB | 一致性Hash策略(未實現(xiàn)) NO | |
NO |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: