public static final class DestinationRuleOuterClass.Subset.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder> 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| 限定符和类型 | 方法和说明 |
|---|---|
DestinationRuleOuterClass.Subset.Builder |
addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
DestinationRuleOuterClass.Subset |
build() |
DestinationRuleOuterClass.Subset |
buildPartial() |
DestinationRuleOuterClass.Subset.Builder |
clear() |
DestinationRuleOuterClass.Subset.Builder |
clearField(com.google.protobuf.Descriptors.FieldDescriptor field) |
DestinationRuleOuterClass.Subset.Builder |
clearLabels() |
DestinationRuleOuterClass.Subset.Builder |
clearName()
Name of the subset.
|
DestinationRuleOuterClass.Subset.Builder |
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) |
DestinationRuleOuterClass.Subset.Builder |
clearTrafficPolicy()
Traffic policies that apply to this subset.
|
DestinationRuleOuterClass.Subset.Builder |
clone() |
boolean |
containsLabels(String key)
Labels apply a filter over the endpoints of a service in the
service registry.
|
DestinationRuleOuterClass.Subset |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
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.
|
Map<String,String> |
getMutableLabels()
已过时。
|
String |
getName()
Name of the subset.
|
com.google.protobuf.ByteString |
getNameBytes()
Name of the subset.
|
DestinationRuleOuterClass.TrafficPolicy |
getTrafficPolicy()
Traffic policies that apply to this subset.
|
DestinationRuleOuterClass.TrafficPolicy.Builder |
getTrafficPolicyBuilder()
Traffic policies that apply to this subset.
|
DestinationRuleOuterClass.TrafficPolicyOrBuilder |
getTrafficPolicyOrBuilder()
Traffic policies that apply to this subset.
|
boolean |
hasTrafficPolicy()
Traffic policies that apply to this subset.
|
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
protected com.google.protobuf.MapField |
internalGetMapField(int number) |
protected com.google.protobuf.MapField |
internalGetMutableMapField(int number) |
boolean |
isInitialized() |
DestinationRuleOuterClass.Subset.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
DestinationRuleOuterClass.Subset.Builder |
mergeFrom(DestinationRuleOuterClass.Subset other) |
DestinationRuleOuterClass.Subset.Builder |
mergeFrom(com.google.protobuf.Message other) |
DestinationRuleOuterClass.Subset.Builder |
mergeTrafficPolicy(DestinationRuleOuterClass.TrafficPolicy value)
Traffic policies that apply to this subset.
|
DestinationRuleOuterClass.Subset.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
DestinationRuleOuterClass.Subset.Builder |
putAllLabels(Map<String,String> values)
Labels apply a filter over the endpoints of a service in the
service registry.
|
DestinationRuleOuterClass.Subset.Builder |
putLabels(String key,
String value)
Labels apply a filter over the endpoints of a service in the
service registry.
|
DestinationRuleOuterClass.Subset.Builder |
removeLabels(String key)
Labels apply a filter over the endpoints of a service in the
service registry.
|
DestinationRuleOuterClass.Subset.Builder |
setField(com.google.protobuf.Descriptors.FieldDescriptor field,
Object value) |
DestinationRuleOuterClass.Subset.Builder |
setName(String value)
Name of the subset.
|
DestinationRuleOuterClass.Subset.Builder |
setNameBytes(com.google.protobuf.ByteString value)
Name of the subset.
|
DestinationRuleOuterClass.Subset.Builder |
setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
Object value) |
DestinationRuleOuterClass.Subset.Builder |
setTrafficPolicy(DestinationRuleOuterClass.TrafficPolicy.Builder builderForValue)
Traffic policies that apply to this subset.
|
DestinationRuleOuterClass.Subset.Builder |
setTrafficPolicy(DestinationRuleOuterClass.TrafficPolicy value)
Traffic policies that apply to this subset.
|
DestinationRuleOuterClass.Subset.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, 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.MapField internalGetMapField(int number)
internalGetMapField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>protected com.google.protobuf.MapField internalGetMutableMapField(int number)
internalGetMutableMapField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>public DestinationRuleOuterClass.Subset.Builder clear()
clear 在接口中 com.google.protobuf.Message.Builderclear 在接口中 com.google.protobuf.MessageLite.Builderclear 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType 在接口中 com.google.protobuf.Message.BuildergetDescriptorForType 在接口中 com.google.protobuf.MessageOrBuildergetDescriptorForType 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>public DestinationRuleOuterClass.Subset getDefaultInstanceForType()
getDefaultInstanceForType 在接口中 com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType 在接口中 com.google.protobuf.MessageOrBuilderpublic DestinationRuleOuterClass.Subset build()
build 在接口中 com.google.protobuf.Message.Builderbuild 在接口中 com.google.protobuf.MessageLite.Builderpublic DestinationRuleOuterClass.Subset buildPartial()
buildPartial 在接口中 com.google.protobuf.Message.BuilderbuildPartial 在接口中 com.google.protobuf.MessageLite.Builderpublic DestinationRuleOuterClass.Subset.Builder clone()
clone 在接口中 com.google.protobuf.Message.Builderclone 在接口中 com.google.protobuf.MessageLite.Builderclone 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>public DestinationRuleOuterClass.Subset.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
setField 在接口中 com.google.protobuf.Message.BuildersetField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>public DestinationRuleOuterClass.Subset.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
clearField 在接口中 com.google.protobuf.Message.BuilderclearField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>public DestinationRuleOuterClass.Subset.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
clearOneof 在接口中 com.google.protobuf.Message.BuilderclearOneof 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>public DestinationRuleOuterClass.Subset.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
setRepeatedField 在接口中 com.google.protobuf.Message.BuildersetRepeatedField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>public DestinationRuleOuterClass.Subset.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
addRepeatedField 在接口中 com.google.protobuf.Message.BuilderaddRepeatedField 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>public DestinationRuleOuterClass.Subset.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom 在接口中 com.google.protobuf.Message.BuildermergeFrom 在类中 com.google.protobuf.AbstractMessage.Builder<DestinationRuleOuterClass.Subset.Builder>public DestinationRuleOuterClass.Subset.Builder mergeFrom(DestinationRuleOuterClass.Subset other)
public final boolean isInitialized()
isInitialized 在接口中 com.google.protobuf.MessageLiteOrBuilderisInitialized 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>public DestinationRuleOuterClass.Subset.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.Subset.Builder>IOExceptionpublic 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 DestinationRuleOuterClass.Subset.Builder setName(String value)
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];value - The name to set.public DestinationRuleOuterClass.Subset.Builder clearName()
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];public DestinationRuleOuterClass.Subset.Builder setNameBytes(com.google.protobuf.ByteString value)
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];value - The bytes for name to set.public 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 DestinationRuleOuterClass.Subset.Builder clearLabels()
public DestinationRuleOuterClass.Subset.Builder removeLabels(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> getMutableLabels()
public DestinationRuleOuterClass.Subset.Builder putLabels(String key, String value)
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 DestinationRuleOuterClass.Subset.Builder putAllLabels(Map<String,String> values)
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.Subset.Builder setTrafficPolicy(DestinationRuleOuterClass.TrafficPolicy value)
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 DestinationRuleOuterClass.Subset.Builder setTrafficPolicy(DestinationRuleOuterClass.TrafficPolicy.Builder builderForValue)
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 DestinationRuleOuterClass.Subset.Builder mergeTrafficPolicy(DestinationRuleOuterClass.TrafficPolicy value)
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 DestinationRuleOuterClass.Subset.Builder clearTrafficPolicy()
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 DestinationRuleOuterClass.TrafficPolicy.Builder getTrafficPolicyBuilder()
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 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 DestinationRuleOuterClass.Subset.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
setUnknownFields 在接口中 com.google.protobuf.Message.BuildersetUnknownFields 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>public final DestinationRuleOuterClass.Subset.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
mergeUnknownFields 在接口中 com.google.protobuf.Message.BuildermergeUnknownFields 在类中 com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>Copyright © 2018–2023 Alibaba Group. All rights reserved.