public static final class DestinationRuleOuterClass.LoadBalancerSettings extends com.google.protobuf.GeneratedMessageV3 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| 限定符和类型 | 类和说明 |
|---|---|
static class |
DestinationRuleOuterClass.LoadBalancerSettings.Builder
Load balancing policies to apply for a specific destination.
|
static class |
DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLB
Consistent Hash-based load balancing can be used to provide soft
session affinity based on HTTP headers, cookies or other
properties.
|
static interface |
DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLBOrBuilder |
static class |
DestinationRuleOuterClass.LoadBalancerSettings.LbPolicyCase |
static class |
DestinationRuleOuterClass.LoadBalancerSettings.SimpleLB
Standard load balancing algorithms that require no tuning.
|
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter| 限定符和类型 | 字段和说明 |
|---|---|
static int |
CONSISTENT_HASH_FIELD_NUMBER |
static int |
LOCALITY_LB_SETTING_FIELD_NUMBER |
static int |
SIMPLE_FIELD_NUMBER |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(Object obj) |
DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLB |
getConsistentHash()
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2; |
DestinationRuleOuterClass.LoadBalancerSettings.ConsistentHashLBOrBuilder |
getConsistentHashOrBuilder()
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2; |
static DestinationRuleOuterClass.LoadBalancerSettings |
getDefaultInstance() |
DestinationRuleOuterClass.LoadBalancerSettings |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
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.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; |
com.google.protobuf.Parser<DestinationRuleOuterClass.LoadBalancerSettings> |
getParserForType() |
int |
getSerializedSize() |
DestinationRuleOuterClass.LoadBalancerSettings.SimpleLB |
getSimple()
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1; |
int |
getSimpleValue()
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1; |
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
boolean |
hasConsistentHash()
.istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB consistent_hash = 2; |
int |
hashCode() |
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() |
static DestinationRuleOuterClass.LoadBalancerSettings.Builder |
newBuilder() |
static DestinationRuleOuterClass.LoadBalancerSettings.Builder |
newBuilder(DestinationRuleOuterClass.LoadBalancerSettings prototype) |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
newBuilderForType() |
protected DestinationRuleOuterClass.LoadBalancerSettings.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static DestinationRuleOuterClass.LoadBalancerSettings |
parseDelimitedFrom(InputStream input) |
static DestinationRuleOuterClass.LoadBalancerSettings |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DestinationRuleOuterClass.LoadBalancerSettings |
parseFrom(byte[] data) |
static DestinationRuleOuterClass.LoadBalancerSettings |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DestinationRuleOuterClass.LoadBalancerSettings |
parseFrom(ByteBuffer data) |
static DestinationRuleOuterClass.LoadBalancerSettings |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DestinationRuleOuterClass.LoadBalancerSettings |
parseFrom(com.google.protobuf.ByteString data) |
static DestinationRuleOuterClass.LoadBalancerSettings |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DestinationRuleOuterClass.LoadBalancerSettings |
parseFrom(com.google.protobuf.CodedInputStream input) |
static DestinationRuleOuterClass.LoadBalancerSettings |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DestinationRuleOuterClass.LoadBalancerSettings |
parseFrom(InputStream input) |
static DestinationRuleOuterClass.LoadBalancerSettings |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<DestinationRuleOuterClass.LoadBalancerSettings> |
parser() |
DestinationRuleOuterClass.LoadBalancerSettings.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTopublic static final int SIMPLE_FIELD_NUMBER
public static final int CONSISTENT_HASH_FIELD_NUMBER
public static final int LOCALITY_LB_SETTING_FIELD_NUMBER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance 在类中 com.google.protobuf.GeneratedMessageV3public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields 在接口中 com.google.protobuf.MessageOrBuildergetUnknownFields 在类中 com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable 在类中 com.google.protobuf.GeneratedMessageV3public DestinationRuleOuterClass.LoadBalancerSettings.LbPolicyCase getLbPolicyCase()
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.SimpleLB getSimple()
.istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB simple = 1;getSimple 在接口中 DestinationRuleOuterClass.LoadBalancerSettingsOrBuilderpublic 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.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.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 boolean isInitialized()
isInitialized 在接口中 com.google.protobuf.MessageLiteOrBuilderisInitialized 在类中 com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws IOException
writeTo 在接口中 com.google.protobuf.MessageLitewriteTo 在类中 com.google.protobuf.GeneratedMessageV3IOExceptionpublic int getSerializedSize()
getSerializedSize 在接口中 com.google.protobuf.MessageLitegetSerializedSize 在类中 com.google.protobuf.GeneratedMessageV3public boolean equals(Object obj)
equals 在接口中 com.google.protobuf.Messageequals 在类中 com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode 在接口中 com.google.protobuf.MessagehashCode 在类中 com.google.protobuf.AbstractMessagepublic static DestinationRuleOuterClass.LoadBalancerSettings parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DestinationRuleOuterClass.LoadBalancerSettings parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DestinationRuleOuterClass.LoadBalancerSettings parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DestinationRuleOuterClass.LoadBalancerSettings parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DestinationRuleOuterClass.LoadBalancerSettings parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DestinationRuleOuterClass.LoadBalancerSettings parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DestinationRuleOuterClass.LoadBalancerSettings parseFrom(InputStream input) throws IOException
IOExceptionpublic static DestinationRuleOuterClass.LoadBalancerSettings parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static DestinationRuleOuterClass.LoadBalancerSettings parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static DestinationRuleOuterClass.LoadBalancerSettings parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static DestinationRuleOuterClass.LoadBalancerSettings parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static DestinationRuleOuterClass.LoadBalancerSettings parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic DestinationRuleOuterClass.LoadBalancerSettings.Builder newBuilderForType()
newBuilderForType 在接口中 com.google.protobuf.MessagenewBuilderForType 在接口中 com.google.protobuf.MessageLitepublic static DestinationRuleOuterClass.LoadBalancerSettings.Builder newBuilder()
public static DestinationRuleOuterClass.LoadBalancerSettings.Builder newBuilder(DestinationRuleOuterClass.LoadBalancerSettings prototype)
public DestinationRuleOuterClass.LoadBalancerSettings.Builder toBuilder()
toBuilder 在接口中 com.google.protobuf.MessagetoBuilder 在接口中 com.google.protobuf.MessageLiteprotected DestinationRuleOuterClass.LoadBalancerSettings.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType 在类中 com.google.protobuf.GeneratedMessageV3public static DestinationRuleOuterClass.LoadBalancerSettings getDefaultInstance()
public static com.google.protobuf.Parser<DestinationRuleOuterClass.LoadBalancerSettings> parser()
public com.google.protobuf.Parser<DestinationRuleOuterClass.LoadBalancerSettings> getParserForType()
getParserForType 在接口中 com.google.protobuf.MessagegetParserForType 在接口中 com.google.protobuf.MessageLitegetParserForType 在类中 com.google.protobuf.GeneratedMessageV3public DestinationRuleOuterClass.LoadBalancerSettings getDefaultInstanceForType()
getDefaultInstanceForType 在接口中 com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType 在接口中 com.google.protobuf.MessageOrBuilderCopyright © 2018–2023 Alibaba Group. All rights reserved.