类 DestinationRuleOuterClass.Subset.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<DestinationRuleOuterClass.Subset.Builder>
com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
istio.networking.v1alpha3.DestinationRuleOuterClass.Subset.Builder
- 所有已实现的接口:
com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,DestinationRuleOuterClass.SubsetOrBuilder,Cloneable
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-
方法概要
修饰符和类型方法说明addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) build()clear()clearField(com.google.protobuf.Descriptors.FieldDescriptor field) Name of the subset.clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) Traffic policies that apply to this subset.clone()booleancontainsLabels(String key) Labels apply a filter over the endpoints of a service in the service registry.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.Descriptor已过时。intLabels apply a filter over the endpoints of a service in the service registry.Labels apply a filter over the endpoints of a service in the service registry.getLabelsOrDefault(String key, String defaultValue) Labels apply a filter over the endpoints of a service in the service registry.getLabelsOrThrow(String key) Labels apply a filter over the endpoints of a service in the service registry.已过时。getName()Name of the subset.com.google.protobuf.ByteStringName of the subset.Traffic policies that apply to this subset.Traffic policies that apply to this subset.Traffic policies that apply to this subset.booleanTraffic policies that apply to this subset.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableprotected com.google.protobuf.MapFieldReflectionAccessorinternalGetMapFieldReflection(int number) protected com.google.protobuf.MapFieldReflectionAccessorinternalGetMutableMapFieldReflection(int number) final booleanmergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) Traffic policies that apply to this subset.mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) putAllLabels(Map<String, String> values) Labels apply a filter over the endpoints of a service in the service registry.Labels apply a filter over the endpoints of a service in the service registry.removeLabels(String key) Labels apply a filter over the endpoints of a service in the service registry.Name of the subset.setNameBytes(com.google.protobuf.ByteString value) Name of the subset.setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) Traffic policies that apply to this subset.setTrafficPolicy(DestinationRuleOuterClass.TrafficPolicy.Builder builderForValue) Traffic policies that apply to this subset.setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) 从类继承的方法 com.google.protobuf.GeneratedMessageV3.Builder
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMutableMapField, isClean, markClean, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setUnknownFieldSetBuilder, setUnknownFieldsProto3从类继承的方法 com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString从类继承的方法 com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException从接口继承的方法 com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFrom从接口继承的方法 com.google.protobuf.MessageLite.Builder
mergeFrom从接口继承的方法 com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
方法详细资料
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) - 覆盖:
internalGetMapFieldReflection在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-
internalGetMutableMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number) - 覆盖:
internalGetMutableMapFieldReflection在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- 指定者:
internalGetFieldAccessorTable在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-
clear
- 指定者:
clear在接口中com.google.protobuf.Message.Builder- 指定者:
clear在接口中com.google.protobuf.MessageLite.Builder- 覆盖:
clear在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- 指定者:
getDescriptorForType在接口中com.google.protobuf.Message.Builder- 指定者:
getDescriptorForType在接口中com.google.protobuf.MessageOrBuilder- 覆盖:
getDescriptorForType在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-
getDefaultInstanceForType
- 指定者:
getDefaultInstanceForType在接口中com.google.protobuf.MessageLiteOrBuilder- 指定者:
getDefaultInstanceForType在接口中com.google.protobuf.MessageOrBuilder
-
build
- 指定者:
build在接口中com.google.protobuf.Message.Builder- 指定者:
build在接口中com.google.protobuf.MessageLite.Builder
-
buildPartial
- 指定者:
buildPartial在接口中com.google.protobuf.Message.Builder- 指定者:
buildPartial在接口中com.google.protobuf.MessageLite.Builder
-
clone
- 指定者:
clone在接口中com.google.protobuf.Message.Builder- 指定者:
clone在接口中com.google.protobuf.MessageLite.Builder- 覆盖:
clone在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-
setField
public DestinationRuleOuterClass.Subset.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - 指定者:
setField在接口中com.google.protobuf.Message.Builder- 覆盖:
setField在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-
clearField
public DestinationRuleOuterClass.Subset.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) - 指定者:
clearField在接口中com.google.protobuf.Message.Builder- 覆盖:
clearField在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-
clearOneof
public DestinationRuleOuterClass.Subset.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) - 指定者:
clearOneof在接口中com.google.protobuf.Message.Builder- 覆盖:
clearOneof在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-
setRepeatedField
public DestinationRuleOuterClass.Subset.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value) - 指定者:
setRepeatedField在接口中com.google.protobuf.Message.Builder- 覆盖:
setRepeatedField在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-
addRepeatedField
public DestinationRuleOuterClass.Subset.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) - 指定者:
addRepeatedField在接口中com.google.protobuf.Message.Builder- 覆盖:
addRepeatedField在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-
mergeFrom
- 指定者:
mergeFrom在接口中com.google.protobuf.Message.Builder- 覆盖:
mergeFrom在类中com.google.protobuf.AbstractMessage.Builder<DestinationRuleOuterClass.Subset.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- 指定者:
isInitialized在接口中com.google.protobuf.MessageLiteOrBuilder- 覆盖:
isInitialized在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-
mergeFrom
public DestinationRuleOuterClass.Subset.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - 指定者:
mergeFrom在接口中com.google.protobuf.Message.Builder- 指定者:
mergeFrom在接口中com.google.protobuf.MessageLite.Builder- 覆盖:
mergeFrom在类中com.google.protobuf.AbstractMessage.Builder<DestinationRuleOuterClass.Subset.Builder>- 抛出:
IOException
-
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.SubsetOrBuilder- 返回:
- The name.
-
getNameBytes
public 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.SubsetOrBuilder- 返回:
- The bytes for name.
-
setName
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.- 返回:
- This builder for chaining.
-
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];- 返回:
- This builder for chaining.
-
setNameBytes
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.- 返回:
- This builder for chaining.
-
getLabelsCount
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; -
containsLabels
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; -
getLabels
已过时。UsegetLabelsMap()instead. -
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; -
getLabelsOrDefault
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; -
getLabelsOrThrow
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; -
clearLabels
-
removeLabels
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; -
getMutableLabels
已过时。Use alternate mutation accessors instead. -
putLabels
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; -
putAllLabels
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; -
hasTrafficPolicy
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.SubsetOrBuilder- 返回:
- Whether the trafficPolicy field is set.
-
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.SubsetOrBuilder- 返回:
- The trafficPolicy.
-
setTrafficPolicy
public 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; -
setTrafficPolicy
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; -
mergeTrafficPolicy
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; -
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; -
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; -
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; -
setUnknownFields
public final DestinationRuleOuterClass.Subset.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - 指定者:
setUnknownFields在接口中com.google.protobuf.Message.Builder- 覆盖:
setUnknownFields在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-
mergeUnknownFields
public final DestinationRuleOuterClass.Subset.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields) - 指定者:
mergeUnknownFields在接口中com.google.protobuf.Message.Builder- 覆盖:
mergeUnknownFields在类中com.google.protobuf.GeneratedMessageV3.Builder<DestinationRuleOuterClass.Subset.Builder>
-