public static final class DestinationRuleOuterClass.LoadBalancerSettings.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder> implements DestinationRuleOuterClass.LoadBalancerSettingsOrBuilder
Load balancing policies to apply for a specific destination. See Envoy's
load balancing
[documentation](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/load_balancing)
for more details.
For example, the following rule uses a round robin load balancing policy
for all traffic going to the ratings service.
{{<tabset category-name="example">}}
{{<tab name="v1alpha3" category-value="v1alpha3">}}
```yaml
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: bookinfo-ratings
spec:
host: ratings.prod.svc.cluster.local
trafficPolicy:
loadBalancer:
simple: ROUND_ROBIN
```
{{</tab>}}
{{<tab name="v1beta1" category-value="v1beta1">}}
```yaml
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: bookinfo-ratings
spec:
host: ratings.prod.svc.cluster.local
trafficPolicy:
loadBalancer:
simple: ROUND_ROBIN
```
{{</tab>}}
{{</tabset>}}
The following example sets up sticky sessions for the ratings service
hashing-based load balancer for the same ratings service using the
the User cookie as the hash key.
{{<tabset category-name="example">}}
{{<tab name="v1alpha3" category-value="v1alpha3">}}
```yaml
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: bookinfo-ratings
spec:
host: ratings.prod.svc.cluster.local
trafficPolicy:
loadBalancer:
consistentHash:
httpCookie:
name: user
ttl: 0s
```
{{</tab>}}
{{<tab name="v1beta1" category-value="v1beta1">}}
```yaml
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: bookinfo-ratings
spec:
host: ratings.prod.svc.cluster.local
trafficPolicy:
loadBalancer:
consistentHash:
httpCookie:
name: user
ttl: 0s
```
{{</tab>}}
{{</tabset>}}
Protobuf type istio.networking.v1alpha3.LoadBalancerSettings| 限定符和类型 | 方法和说明 |
|---|---|
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
DestinationRuleOuterClass.LoadBalancerSettings |
build() |
DestinationRuleOuterClass.LoadBalancerSettings |
buildPartial() |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
clear() |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
clearConsistentHash()
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2; |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
clearLbPolicy() |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
clearLocalityLbSetting()
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed
between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3; |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
clearSimple()
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1; |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
clone() |
DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLB |
getConsistentHash()
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2; |
DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLB.Builder |
getConsistentHashBuilder()
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2; |
DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLBOrBuilder |
getConsistentHashOrBuilder()
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2; |
DestinationRuleOuterClass.LoadBalancerSettings |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
DestinationRuleOuterClass.LoadBalancerSettings.LbPolicyCase |
getLbPolicyCase() |
DestinationRuleOuterClass.LocalityLoadBalancerSetting |
getLocalityLbSetting()
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed
between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3; |
DestinationRuleOuterClass.LocalityLoadBalancerSetting.Builder |
getLocalityLbSettingBuilder()
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed
between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3; |
DestinationRuleOuterClass.LocalityLoadBalancerSettingOrBuilder |
getLocalityLbSettingOrBuilder()
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed
between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3; |
DestinationRuleOuterClass.LoadBalancerSettings.SimpleLB |
getSimple()
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1; |
int |
getSimpleValue()
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1; |
boolean |
hasConsistentHash()
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2; |
boolean |
hasLocalityLbSetting()
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed
between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3; |
boolean |
hasSimple()
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1; |
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
mergeConsistentHash(DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLB value)
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2; |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
mergeFrom(DestinationRuleOuterClass.LoadBalancerSettings other) |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
mergeFrom(com.google.protobuf.Message other) |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
mergeLocalityLbSetting(DestinationRuleOuterClass.LocalityLoadBalancerSetting value)
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed
between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3; |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
setConsistentHash(DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLB.Builder builderForValue)
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2; |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
setConsistentHash(DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLB value)
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2; |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
setLocalityLbSetting(DestinationRuleOuterClass.LocalityLoadBalancerSetting.Builder builderForValue)
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed
between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3; |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
setLocalityLbSetting(DestinationRuleOuterClass.LocalityLoadBalancerSetting value)
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed
between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3; |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
setSimple(DestinationRuleOuterClass.LoadBalancerSettings.SimpleLB value)
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1; |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
setSimpleValue(int value)
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1; |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>public DestinationRuleOuterClass.LoadBalancerSettings.Builder clear()
clear 在接口中 com.google.protobuf.Message.Builderclear 在接口中 com.google.protobuf.MessageLite.Builderclear 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType 在接口中 com.google.protobuf.Message.BuildergetDescriptorForType 在接口中 com.google.protobuf.MessageOrBuildergetDescriptorForType 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>public DestinationRuleOuterClass.LoadBalancerSettings getDefaultInstanceForType()
getDefaultInstanceForType 在接口中 com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType 在接口中 com.google.protobuf.MessageOrBuilderpublic DestinationRuleOuterClass.LoadBalancerSettings build()
build 在接口中 com.google.protobuf.Message.Builderbuild 在接口中 com.google.protobuf.MessageLite.Builderpublic DestinationRuleOuterClass.LoadBalancerSettings buildPartial()
buildPartial 在接口中 com.google.protobuf.Message.BuilderbuildPartial 在接口中 com.google.protobuf.MessageLite.Builderpublic DestinationRuleOuterClass.LoadBalancerSettings.Builder clone()
clone 在接口中 com.google.protobuf.Message.Builderclone 在接口中 com.google.protobuf.MessageLite.Builderclone 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>public DestinationRuleOuterClass.LoadBalancerSettings.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField 在接口中 com.google.protobuf.Message.BuildersetField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>public DestinationRuleOuterClass.LoadBalancerSettings.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField 在接口中 com.google.protobuf.Message.BuilderclearField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>public DestinationRuleOuterClass.LoadBalancerSettings.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof 在接口中 com.google.protobuf.Message.BuilderclearOneof 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>public DestinationRuleOuterClass.LoadBalancerSettings.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField 在接口中 com.google.protobuf.Message.BuildersetRepeatedField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>public DestinationRuleOuterClass.LoadBalancerSettings.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField 在接口中 com.google.protobuf.Message.BuilderaddRepeatedField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>public DestinationRuleOuterClass.LoadBalancerSettings.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom 在接口中 com.google.protobuf.Message.BuildermergeFrom 在类中 com.google.protobuf.AbstractMessage.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>public DestinationRuleOuterClass.LoadBalancerSettings.Builder mergeFrom(DestinationRuleOuterClass.LoadBalancerSettings other)
public final boolean isInitialized()
isInitialized 在接口中 com.google.protobuf.MessageLiteOrBuilderisInitialized 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>public DestinationRuleOuterClass.LoadBalancerSettings.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom 在接口中 com.google.protobuf.Message.BuildermergeFrom 在接口中 com.google.protobuf.MessageLite.BuildermergeFrom 在类中 com.google.protobuf.AbstractMessage.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>IOExceptionpublic DestinationRuleOuterClass.LoadBalancerSettings.LbPolicyCase getLbPolicyCase()
public DestinationRuleOuterClass.LoadBalancerSettings.Builder clearLbPolicy()
public boolean hasSimple()
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1;hasSimple 在接口中 DestinationRuleOuterClass.LoadBalancerSettingsOrBuilderpublic int getSimpleValue()
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1;getSimpleValue 在接口中 DestinationRuleOuterClass.LoadBalancerSettingsOrBuilderpublic DestinationRuleOuterClass.LoadBalancerSettings.Builder setSimpleValue(int value)
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1;value - The enum numeric value on the wire for simple to set.public DestinationRuleOuterClass.LoadBalancerSettings.SimpleLB getSimple()
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1;getSimple 在接口中 DestinationRuleOuterClass.LoadBalancerSettingsOrBuilderpublic DestinationRuleOuterClass.LoadBalancerSettings.Builder setSimple(DestinationRuleOuterClass.LoadBalancerSettings.SimpleLB value)
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1;value - The simple to set.public DestinationRuleOuterClass.LoadBalancerSettings.Builder clearSimple()
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1;public boolean hasConsistentHash()
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2;hasConsistentHash 在接口中 DestinationRuleOuterClass.LoadBalancerSettingsOrBuilderpublic DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLB getConsistentHash()
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2;getConsistentHash 在接口中 DestinationRuleOuterClass.LoadBalancerSettingsOrBuilderpublic DestinationRuleOuterClass.LoadBalancerSettings.Builder setConsistentHash(DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLB value)
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2;public DestinationRuleOuterClass.LoadBalancerSettings.Builder setConsistentHash(DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLB.Builder builderForValue)
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2;public DestinationRuleOuterClass.LoadBalancerSettings.Builder mergeConsistentHash(DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLB value)
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2;public DestinationRuleOuterClass.LoadBalancerSettings.Builder clearConsistentHash()
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2;public DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLB.Builder getConsistentHashBuilder()
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2;public DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLBOrBuilder getConsistentHashOrBuilder()
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2;public boolean hasLocalityLbSetting()
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3;hasLocalityLbSetting 在接口中 DestinationRuleOuterClass.LoadBalancerSettingsOrBuilderpublic DestinationRuleOuterClass.LocalityLoadBalancerSetting getLocalityLbSetting()
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3;getLocalityLbSetting 在接口中 DestinationRuleOuterClass.LoadBalancerSettingsOrBuilderpublic DestinationRuleOuterClass.LoadBalancerSettings.Builder setLocalityLbSetting(DestinationRuleOuterClass.LocalityLoadBalancerSetting value)
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3;public DestinationRuleOuterClass.LoadBalancerSettings.Builder setLocalityLbSetting(DestinationRuleOuterClass.LocalityLoadBalancerSetting.Builder builderForValue)
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3;public DestinationRuleOuterClass.LoadBalancerSettings.Builder mergeLocalityLbSetting(DestinationRuleOuterClass.LocalityLoadBalancerSetting value)
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3;public DestinationRuleOuterClass.LoadBalancerSettings.Builder clearLocalityLbSetting()
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3;public DestinationRuleOuterClass.LocalityLoadBalancerSetting.Builder getLocalityLbSettingBuilder()
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3;public DestinationRuleOuterClass.LocalityLoadBalancerSettingOrBuilder getLocalityLbSettingOrBuilder()
Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed between this object and the object one in MeshConfig
.istio.networking.v1alpha3.LocalityLoadBalancerSetting locality_lb_setting = 3;public final DestinationRuleOuterClass.LoadBalancerSettings.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields 在接口中 com.google.protobuf.Message.BuildersetUnknownFields 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>public final DestinationRuleOuterClass.LoadBalancerSettings.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields 在接口中 com.google.protobuf.Message.BuildermergeUnknownFields 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.LoadBalancerSettings.Builder>Copyright © 2018–2023 Alibaba Group. All rights reserved.