public static final class DestinationRuleOuterClass.Subset extends com.google.protobuf.GeneratedMessageV3 implements DestinationRuleOuterClass.SubsetOrBuilder
A subset of endpoints of a service. Subsets can be used for scenarios
like A/B testing, or routing to a specific version of a service. Refer
to [VirtualService](https://istio.io/docs/reference/config/networking/virtual-service/#VirtualService) documentation for examples of using
subsets in these scenarios. In addition, traffic policies defined at the
service-level can be overridden at a subset-level. The following rule
uses a round robin load balancing policy for all traffic going to a
subset named testversion that is composed of endpoints (e.g., pods) with
labels (version:v3).
{{<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: LEAST_CONN
subsets:
- name: testversion
labels:
version: v3
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: LEAST_CONN
subsets:
- name: testversion
labels:
version: v3
trafficPolicy:
loadBalancer:
simple: ROUND_ROBIN
```
{{</tab>}}
{{</tabset>}}
**Note:** Policies specified for subsets will not take effect until
a route rule explicitly sends traffic to this subset.
One or more labels are typically required to identify the subset destination,
however, when the corresponding DestinationRule represents a host that
supports multiple SNI hosts (e.g., an egress gateway), a subset without labels
may be meaningful. In this case a traffic policy with [ClientTLSSettings](#ClientTLSSettings)
can be used to identify a specific SNI host corresponding to the named subset.
Protobuf type istio.networking.v1alpha3.Subset| 限定符和类型 | 类和说明 |
|---|---|
static class |
DestinationRuleOuterClass.Subset.Builder
A subset of endpoints of a service.
|
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 |
LABELS_FIELD_NUMBER |
static int |
NAME_FIELD_NUMBER |
static int |
TRAFFIC_POLICY_FIELD_NUMBER |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
containsLabels(String key)
Labels apply a filter over the endpoints of a service in the
service registry.
|
boolean |
equals(Object obj) |
static DestinationRuleOuterClass.Subset |
getDefaultInstance() |
DestinationRuleOuterClass.Subset |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
Map<String,String> |
getLabels()
已过时。
|
int |
getLabelsCount()
Labels apply a filter over the endpoints of a service in the
service registry.
|
Map<String,String> |
getLabelsMap()
Labels apply a filter over the endpoints of a service in the
service registry.
|
String |
getLabelsOrDefault(String key,
String defaultValue)
Labels apply a filter over the endpoints of a service in the
service registry.
|
String |
getLabelsOrThrow(String key)
Labels apply a filter over the endpoints of a service in the
service registry.
|
String |
getName()
Name of the subset.
|
com.google.protobuf.ByteString |
getNameBytes()
Name of the subset.
|
com.google.protobuf.Parser<DestinationRuleOuterClass.Subset> |
getParserForType() |
int |
getSerializedSize() |
DestinationRuleOuterClass.TrafficPolicy |
getTrafficPolicy()
Traffic policies that apply to this subset.
|
DestinationRuleOuterClass.TrafficPolicyOrBuilder |
getTrafficPolicyOrBuilder()
Traffic policies that apply to this subset.
|
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
boolean |
hasTrafficPolicy()
Traffic policies that apply to this subset.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
protected com.google.protobuf.MapField |
internalGetMapField(int number) |
boolean |
isInitialized() |
static DestinationRuleOuterClass.Subset.Builder |
newBuilder() |
static DestinationRuleOuterClass.Subset.Builder |
newBuilder(DestinationRuleOuterClass.Subset prototype) |
DestinationRuleOuterClass.Subset.Builder |
newBuilderForType() |
protected DestinationRuleOuterClass.Subset.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static DestinationRuleOuterClass.Subset |
parseDelimitedFrom(InputStream input) |
static DestinationRuleOuterClass.Subset |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DestinationRuleOuterClass.Subset |
parseFrom(byte[] data) |
static DestinationRuleOuterClass.Subset |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DestinationRuleOuterClass.Subset |
parseFrom(ByteBuffer data) |
static DestinationRuleOuterClass.Subset |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DestinationRuleOuterClass.Subset |
parseFrom(com.google.protobuf.ByteString data) |
static DestinationRuleOuterClass.Subset |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DestinationRuleOuterClass.Subset |
parseFrom(com.google.protobuf.CodedInputStream input) |
static DestinationRuleOuterClass.Subset |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DestinationRuleOuterClass.Subset |
parseFrom(InputStream input) |
static DestinationRuleOuterClass.Subset |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<DestinationRuleOuterClass.Subset> |
parser() |
DestinationRuleOuterClass.Subset.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, 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 NAME_FIELD_NUMBER
public static final int LABELS_FIELD_NUMBER
public static final int TRAFFIC_POLICY_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.MapField internalGetMapField(int number)
internalGetMapField 在类中 com.google.protobuf.GeneratedMessageV3protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable 在类中 com.google.protobuf.GeneratedMessageV3public String getName()
Name of the subset. The service name and the subset name can be used for traffic splitting in a route rule.
string name = 1 [(.google.api.field_behavior) = REQUIRED];getName 在接口中 DestinationRuleOuterClass.SubsetOrBuilderpublic com.google.protobuf.ByteString getNameBytes()
Name of the subset. The service name and the subset name can be used for traffic splitting in a route rule.
string name = 1 [(.google.api.field_behavior) = REQUIRED];getNameBytes 在接口中 DestinationRuleOuterClass.SubsetOrBuilderpublic int getLabelsCount()
Labels apply a filter over the endpoints of a service in the service registry. See route rules for examples of usage.
map<string, string> labels = 2;public boolean containsLabels(String key)
Labels apply a filter over the endpoints of a service in the service registry. See route rules for examples of usage.
map<string, string> labels = 2;@Deprecated public Map<String,String> getLabels()
getLabelsMap() instead.public Map<String,String> getLabelsMap()
Labels apply a filter over the endpoints of a service in the service registry. See route rules for examples of usage.
map<string, string> labels = 2;public String getLabelsOrDefault(String key, String defaultValue)
Labels apply a filter over the endpoints of a service in the service registry. See route rules for examples of usage.
map<string, string> labels = 2;public String getLabelsOrThrow(String key)
Labels apply a filter over the endpoints of a service in the service registry. See route rules for examples of usage.
map<string, string> labels = 2;public boolean hasTrafficPolicy()
Traffic policies that apply to this subset. Subsets inherit the traffic policies specified at the DestinationRule level. Settings specified at the subset level will override the corresponding settings specified at the DestinationRule level.
.istio.networking.v1alpha3.TrafficPolicy traffic_policy = 3;hasTrafficPolicy 在接口中 DestinationRuleOuterClass.SubsetOrBuilderpublic DestinationRuleOuterClass.TrafficPolicy getTrafficPolicy()
Traffic policies that apply to this subset. Subsets inherit the traffic policies specified at the DestinationRule level. Settings specified at the subset level will override the corresponding settings specified at the DestinationRule level.
.istio.networking.v1alpha3.TrafficPolicy traffic_policy = 3;getTrafficPolicy 在接口中 DestinationRuleOuterClass.SubsetOrBuilderpublic DestinationRuleOuterClass.TrafficPolicyOrBuilder getTrafficPolicyOrBuilder()
Traffic policies that apply to this subset. Subsets inherit the traffic policies specified at the DestinationRule level. Settings specified at the subset level will override the corresponding settings specified at the DestinationRule level.
.istio.networking.v1alpha3.TrafficPolicy traffic_policy = 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.Subset parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DestinationRuleOuterClass.Subset parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DestinationRuleOuterClass.Subset parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DestinationRuleOuterClass.Subset parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DestinationRuleOuterClass.Subset parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DestinationRuleOuterClass.Subset parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static DestinationRuleOuterClass.Subset parseFrom(InputStream input) throws IOException
IOExceptionpublic static DestinationRuleOuterClass.Subset parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static DestinationRuleOuterClass.Subset parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static DestinationRuleOuterClass.Subset parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static DestinationRuleOuterClass.Subset parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static DestinationRuleOuterClass.Subset parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic DestinationRuleOuterClass.Subset.Builder newBuilderForType()
newBuilderForType 在接口中 com.google.protobuf.MessagenewBuilderForType 在接口中 com.google.protobuf.MessageLitepublic static DestinationRuleOuterClass.Subset.Builder newBuilder()
public static DestinationRuleOuterClass.Subset.Builder newBuilder(DestinationRuleOuterClass.Subset prototype)
public DestinationRuleOuterClass.Subset.Builder toBuilder()
toBuilder 在接口中 com.google.protobuf.MessagetoBuilder 在接口中 com.google.protobuf.MessageLiteprotected DestinationRuleOuterClass.Subset.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType 在类中 com.google.protobuf.GeneratedMessageV3public static DestinationRuleOuterClass.Subset getDefaultInstance()
public static com.google.protobuf.Parser<DestinationRuleOuterClass.Subset> parser()
public com.google.protobuf.Parser<DestinationRuleOuterClass.Subset> getParserForType()
getParserForType 在接口中 com.google.protobuf.MessagegetParserForType 在接口中 com.google.protobuf.MessageLitegetParserForType 在类中 com.google.protobuf.GeneratedMessageV3public DestinationRuleOuterClass.Subset getDefaultInstanceForType()
getDefaultInstanceForType 在接口中 com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType 在接口中 com.google.protobuf.MessageOrBuilderCopyright © 2018–2023 Alibaba Group. All rights reserved.