public static final class VirtualServiceOuterClass.HTTPRouteDestination extends com.google.protobuf.GeneratedMessageV3 implements VirtualServiceOuterClass.HTTPRouteDestinationOrBuilder
Each routing rule is associated with one or more service versions (see
glossary in beginning of document). Weights associated with the version
determine the proportion of traffic it receives. For example, the
following rule will route 25% of traffic for the "reviews" service to
instances with the "v2" tag and the remaining traffic (i.e., 75%) to
"v1".
{{<tabset category-name="example">}}
{{<tab name="v1alpha3" category-value="v1alpha3">}}
```yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews-route
spec:
hosts:
- reviews.prod.svc.cluster.local
http:
- route:
- destination:
host: reviews.prod.svc.cluster.local
subset: v2
weight: 25
- destination:
host: reviews.prod.svc.cluster.local
subset: v1
weight: 75
```
{{</tab>}}
{{<tab name="v1beta1" category-value="v1beta1">}}
```yaml
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: reviews-route
spec:
hosts:
- reviews.prod.svc.cluster.local
http:
- route:
- destination:
host: reviews.prod.svc.cluster.local
subset: v2
weight: 25
- destination:
host: reviews.prod.svc.cluster.local
subset: v1
weight: 75
```
{{</tab>}}
{{</tabset>}}
And the associated DestinationRule
{{<tabset category-name="example">}}
{{<tab name="v1alpha3" category-value="v1alpha3">}}
```yaml
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: reviews-destination
spec:
host: reviews.prod.svc.cluster.local
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
```
{{</tab>}}
{{<tab name="v1beta1" category-value="v1beta1">}}
```yaml
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: reviews-destination
spec:
host: reviews.prod.svc.cluster.local
subsets:
- name: v1
labels:
version: v1
- name: v2
labels:
version: v2
```
{{</tab>}}
{{</tabset>}}
Traffic can also be split across two entirely different services without
having to define new subsets. For example, the following rule forwards 25% of
traffic to reviews.com to dev.reviews.com
{{<tabset category-name="example">}}
{{<tab name="v1alpha3" category-value="v1alpha3">}}
```yaml
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews-route-two-domains
spec:
hosts:
- reviews.com
http:
- route:
- destination:
host: dev.reviews.com
weight: 25
- destination:
host: reviews.com
weight: 75
```
{{</tab>}}
{{<tab name="v1beta1" category-value="v1beta1">}}
```yaml
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: reviews-route-two-domains
spec:
hosts:
- reviews.com
http:
- route:
- destination:
host: dev.reviews.com
weight: 25
- destination:
host: reviews.com
weight: 75
```
{{</tab>}}
{{</tabset>}}
Protobuf type istio.networking.v1alpha3.HTTPRouteDestination| 限定符和类型 | 类和说明 |
|---|---|
static class |
VirtualServiceOuterClass.HTTPRouteDestination.Builder
Each routing rule is associated with one or more service versions (see
glossary in beginning of document).
|
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 |
DESTINATION_FIELD_NUMBER |
static int |
HEADERS_FIELD_NUMBER |
static int |
WEIGHT_FIELD_NUMBER |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
equals(Object obj) |
static VirtualServiceOuterClass.HTTPRouteDestination |
getDefaultInstance() |
VirtualServiceOuterClass.HTTPRouteDestination |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
VirtualServiceOuterClass.Destination |
getDestination()
Destination uniquely identifies the instances of a service
to which the request/connection should be forwarded to.
|
VirtualServiceOuterClass.DestinationOrBuilder |
getDestinationOrBuilder()
Destination uniquely identifies the instances of a service
to which the request/connection should be forwarded to.
|
VirtualServiceOuterClass.Headers |
getHeaders()
Header manipulation rules
.istio.networking.v1alpha3.Headers headers = 7; |
VirtualServiceOuterClass.HeadersOrBuilder |
getHeadersOrBuilder()
Header manipulation rules
.istio.networking.v1alpha3.Headers headers = 7; |
com.google.protobuf.Parser<VirtualServiceOuterClass.HTTPRouteDestination> |
getParserForType() |
int |
getSerializedSize() |
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
int |
getWeight()
The proportion of traffic to be forwarded to the service
version. (0-100).
|
boolean |
hasDestination()
Destination uniquely identifies the instances of a service
to which the request/connection should be forwarded to.
|
int |
hashCode() |
boolean |
hasHeaders()
Header manipulation rules
.istio.networking.v1alpha3.Headers headers = 7; |
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static VirtualServiceOuterClass.HTTPRouteDestination.Builder |
newBuilder() |
static VirtualServiceOuterClass.HTTPRouteDestination.Builder |
newBuilder(VirtualServiceOuterClass.HTTPRouteDestination prototype) |
VirtualServiceOuterClass.HTTPRouteDestination.Builder |
newBuilderForType() |
protected VirtualServiceOuterClass.HTTPRouteDestination.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static VirtualServiceOuterClass.HTTPRouteDestination |
parseDelimitedFrom(InputStream input) |
static VirtualServiceOuterClass.HTTPRouteDestination |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static VirtualServiceOuterClass.HTTPRouteDestination |
parseFrom(byte[] data) |
static VirtualServiceOuterClass.HTTPRouteDestination |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static VirtualServiceOuterClass.HTTPRouteDestination |
parseFrom(ByteBuffer data) |
static VirtualServiceOuterClass.HTTPRouteDestination |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static VirtualServiceOuterClass.HTTPRouteDestination |
parseFrom(com.google.protobuf.ByteString data) |
static VirtualServiceOuterClass.HTTPRouteDestination |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static VirtualServiceOuterClass.HTTPRouteDestination |
parseFrom(com.google.protobuf.CodedInputStream input) |
static VirtualServiceOuterClass.HTTPRouteDestination |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static VirtualServiceOuterClass.HTTPRouteDestination |
parseFrom(InputStream input) |
static VirtualServiceOuterClass.HTTPRouteDestination |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<VirtualServiceOuterClass.HTTPRouteDestination> |
parser() |
VirtualServiceOuterClass.HTTPRouteDestination.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 DESTINATION_FIELD_NUMBER
public static final int WEIGHT_FIELD_NUMBER
public static final int HEADERS_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 boolean hasDestination()
Destination uniquely identifies the instances of a service to which the request/connection should be forwarded to.
.istio.networking.v1alpha3.Destination destination = 1 [(.google.api.field_behavior) = REQUIRED];hasDestination 在接口中 VirtualServiceOuterClass.HTTPRouteDestinationOrBuilderpublic VirtualServiceOuterClass.Destination getDestination()
Destination uniquely identifies the instances of a service to which the request/connection should be forwarded to.
.istio.networking.v1alpha3.Destination destination = 1 [(.google.api.field_behavior) = REQUIRED];getDestination 在接口中 VirtualServiceOuterClass.HTTPRouteDestinationOrBuilderpublic VirtualServiceOuterClass.DestinationOrBuilder getDestinationOrBuilder()
Destination uniquely identifies the instances of a service to which the request/connection should be forwarded to.
.istio.networking.v1alpha3.Destination destination = 1 [(.google.api.field_behavior) = REQUIRED];public int getWeight()
The proportion of traffic to be forwarded to the service version. (0-100). Sum of weights across destinations SHOULD BE == 100. If there is only one destination in a rule, the weight value is assumed to be 100.
int32 weight = 2;getWeight 在接口中 VirtualServiceOuterClass.HTTPRouteDestinationOrBuilderpublic boolean hasHeaders()
Header manipulation rules
.istio.networking.v1alpha3.Headers headers = 7;hasHeaders 在接口中 VirtualServiceOuterClass.HTTPRouteDestinationOrBuilderpublic VirtualServiceOuterClass.Headers getHeaders()
Header manipulation rules
.istio.networking.v1alpha3.Headers headers = 7;getHeaders 在接口中 VirtualServiceOuterClass.HTTPRouteDestinationOrBuilderpublic VirtualServiceOuterClass.HeadersOrBuilder getHeadersOrBuilder()
Header manipulation rules
.istio.networking.v1alpha3.Headers headers = 7;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 VirtualServiceOuterClass.HTTPRouteDestination parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static VirtualServiceOuterClass.HTTPRouteDestination parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static VirtualServiceOuterClass.HTTPRouteDestination parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static VirtualServiceOuterClass.HTTPRouteDestination parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static VirtualServiceOuterClass.HTTPRouteDestination parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static VirtualServiceOuterClass.HTTPRouteDestination parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static VirtualServiceOuterClass.HTTPRouteDestination parseFrom(InputStream input) throws IOException
IOExceptionpublic static VirtualServiceOuterClass.HTTPRouteDestination parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static VirtualServiceOuterClass.HTTPRouteDestination parseDelimitedFrom(InputStream input) throws IOException
IOExceptionpublic static VirtualServiceOuterClass.HTTPRouteDestination parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic static VirtualServiceOuterClass.HTTPRouteDestination parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOExceptionpublic static VirtualServiceOuterClass.HTTPRouteDestination parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOExceptionpublic VirtualServiceOuterClass.HTTPRouteDestination.Builder newBuilderForType()
newBuilderForType 在接口中 com.google.protobuf.MessagenewBuilderForType 在接口中 com.google.protobuf.MessageLitepublic static VirtualServiceOuterClass.HTTPRouteDestination.Builder newBuilder()
public static VirtualServiceOuterClass.HTTPRouteDestination.Builder newBuilder(VirtualServiceOuterClass.HTTPRouteDestination prototype)
public VirtualServiceOuterClass.HTTPRouteDestination.Builder toBuilder()
toBuilder 在接口中 com.google.protobuf.MessagetoBuilder 在接口中 com.google.protobuf.MessageLiteprotected VirtualServiceOuterClass.HTTPRouteDestination.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType 在类中 com.google.protobuf.GeneratedMessageV3public static VirtualServiceOuterClass.HTTPRouteDestination getDefaultInstance()
public static com.google.protobuf.Parser<VirtualServiceOuterClass.HTTPRouteDestination> parser()
public com.google.protobuf.Parser<VirtualServiceOuterClass.HTTPRouteDestination> getParserForType()
getParserForType 在接口中 com.google.protobuf.MessagegetParserForType 在接口中 com.google.protobuf.MessageLitegetParserForType 在类中 com.google.protobuf.GeneratedMessageV3public VirtualServiceOuterClass.HTTPRouteDestination getDefaultInstanceForType()
getDefaultInstanceForType 在接口中 com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType 在接口中 com.google.protobuf.MessageOrBuilderCopyright © 2018–2023 Alibaba Group. All rights reserved.