类 VirtualServiceOuterClass.Destination
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite
-
- com.google.protobuf.AbstractMessage
-
- com.google.protobuf.GeneratedMessageV3
-
- istio.networking.v1alpha3.VirtualServiceOuterClass.Destination
-
- 所有已实现的接口:
com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,VirtualServiceOuterClass.DestinationOrBuilder,java.io.Serializable
public static final class VirtualServiceOuterClass.Destination extends com.google.protobuf.GeneratedMessageV3 implements VirtualServiceOuterClass.DestinationOrBuilder
Destination indicates the network addressable service to which the request/connection will be sent after processing a routing rule. The destination.host should unambiguously refer to a service in the service registry. Istio's service registry is composed of all the services found in the platform's service registry (e.g., Kubernetes services, Consul services), as well as services declared through the [ServiceEntry](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry) resource. *Note for Kubernetes users*: When short names are used (e.g. "reviews" instead of "reviews.default.svc.cluster.local"), Istio will interpret the short name based on the namespace of the rule, not the service. A rule in the "default" namespace containing a host "reviews will be interpreted as "reviews.default.svc.cluster.local", irrespective of the actual namespace associated with the reviews service. _To avoid potential misconfigurations, it is recommended to always use fully qualified domain names over short names._ The following Kubernetes example routes all traffic by default to pods of the reviews service with label "version: v1" (i.e., subset v1), and some to subset v2, in a Kubernetes environment. {{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: reviews-route namespace: foo spec: hosts: - reviews # interpreted as reviews.foo.svc.cluster.local http: - match: - uri: prefix: "/wpcatalog" - uri: prefix: "/consumercatalog" rewrite: uri: "/newcatalog" route: - destination: host: reviews # interpreted as reviews.foo.svc.cluster.local subset: v2 - route: - destination: host: reviews # interpreted as reviews.foo.svc.cluster.local subset: v1 ``` {{</tab>}} {{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: name: reviews-route namespace: foo spec: hosts: - reviews # interpreted as reviews.foo.svc.cluster.local http: - match: - uri: prefix: "/wpcatalog" - uri: prefix: "/consumercatalog" rewrite: uri: "/newcatalog" route: - destination: host: reviews # interpreted as reviews.foo.svc.cluster.local subset: v2 - route: - destination: host: reviews # interpreted as reviews.foo.svc.cluster.local subset: v1 ``` {{</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 namespace: foo spec: host: reviews # interpreted as reviews.foo.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 namespace: foo spec: host: reviews # interpreted as reviews.foo.svc.cluster.local subsets: - name: v1 labels: version: v1 - name: v2 labels: version: v2 ``` {{</tab>}} {{</tabset>}} The following VirtualService sets a timeout of 5s for all calls to productpage.prod.svc.cluster.local service in Kubernetes. Notice that there are no subsets defined in this rule. Istio will fetch all instances of productpage.prod.svc.cluster.local service from the service registry and populate the sidecar's load balancing pool. Also, notice that this rule is set in the istio-system namespace but uses the fully qualified domain name of the productpage service, productpage.prod.svc.cluster.local. Therefore the rule's namespace does not have an impact in resolving the name of the productpage service. {{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: my-productpage-rule namespace: istio-system spec: hosts: - productpage.prod.svc.cluster.local # ignores rule namespace http: - timeout: 5s route: - destination: host: productpage.prod.svc.cluster.local ``` {{</tab>}} {{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: name: my-productpage-rule namespace: istio-system spec: hosts: - productpage.prod.svc.cluster.local # ignores rule namespace http: - timeout: 5s route: - destination: host: productpage.prod.svc.cluster.local ``` {{</tab>}} {{</tabset>}} To control routing for traffic bound to services outside the mesh, external services must first be added to Istio's internal service registry using the ServiceEntry resource. VirtualServices can then be defined to control traffic bound to these external services. For example, the following rules define a Service for wikipedia.org and set a timeout of 5s for HTTP requests. {{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: ServiceEntry metadata: name: external-svc-wikipedia spec: hosts: - wikipedia.org location: MESH_EXTERNAL ports: - number: 80 name: example-http protocol: HTTP resolution: DNS apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: my-wiki-rule spec: hosts: - wikipedia.org http: - timeout: 5s route: - destination: host: wikipedia.org ``` {{</tab>}} {{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: ServiceEntry metadata: name: external-svc-wikipedia spec: hosts: - wikipedia.org location: MESH_EXTERNAL ports: - number: 80 name: example-http protocol: HTTP resolution: DNS apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: my-wiki-rule spec: hosts: - wikipedia.org http: - timeout: 5s route: - destination: host: wikipedia.org ``` {{</tab>}} {{</tabset>}}Protobuf typeistio.networking.v1alpha3.Destination- 另请参阅:
- 序列化表格
-
-
嵌套类概要
嵌套类 修饰符和类型 类 说明 static classVirtualServiceOuterClass.Destination.BuilderDestination indicates the network addressable service to which the request/connection will be sent after processing a routing rule.-
从类继承的嵌套类/接口 com.google.protobuf.GeneratedMessageV3
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
-
-
字段概要
字段 修饰符和类型 字段 说明 private static VirtualServiceOuterClass.DestinationDEFAULT_INSTANCEprivate java.lang.Objecthost_static intHOST_FIELD_NUMBERprivate bytememoizedIsInitializedprivate static com.google.protobuf.Parser<VirtualServiceOuterClass.Destination>PARSERprivate VirtualServiceOuterClass.PortSelectorport_static intPORT_FIELD_NUMBERprivate static longserialVersionUIDprivate java.lang.Objectsubset_static intSUBSET_FIELD_NUMBER
-
构造器概要
构造器 限定符 构造器 说明 privateDestination()privateDestination(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanequals(java.lang.Object obj)static VirtualServiceOuterClass.DestinationgetDefaultInstance()VirtualServiceOuterClass.DestinationgetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()java.lang.StringgetHost()The name of a service from the service registry.com.google.protobuf.ByteStringgetHostBytes()The name of a service from the service registry.com.google.protobuf.Parser<VirtualServiceOuterClass.Destination>getParserForType()VirtualServiceOuterClass.PortSelectorgetPort()Specifies the port on the host that is being addressed.VirtualServiceOuterClass.PortSelectorOrBuildergetPortOrBuilder()Specifies the port on the host that is being addressed.intgetSerializedSize()java.lang.StringgetSubset()The name of a subset within the service.com.google.protobuf.ByteStringgetSubsetBytes()The name of a subset within the service.com.google.protobuf.UnknownFieldSetgetUnknownFields()inthashCode()booleanhasPort()Specifies the port on the host that is being addressed.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()static VirtualServiceOuterClass.Destination.BuildernewBuilder()static VirtualServiceOuterClass.Destination.BuildernewBuilder(VirtualServiceOuterClass.Destination prototype)VirtualServiceOuterClass.Destination.BuildernewBuilderForType()protected VirtualServiceOuterClass.Destination.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)protected java.lang.ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)static VirtualServiceOuterClass.DestinationparseDelimitedFrom(java.io.InputStream input)static VirtualServiceOuterClass.DestinationparseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static VirtualServiceOuterClass.DestinationparseFrom(byte[] data)static VirtualServiceOuterClass.DestinationparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static VirtualServiceOuterClass.DestinationparseFrom(com.google.protobuf.ByteString data)static VirtualServiceOuterClass.DestinationparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static VirtualServiceOuterClass.DestinationparseFrom(com.google.protobuf.CodedInputStream input)static VirtualServiceOuterClass.DestinationparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static VirtualServiceOuterClass.DestinationparseFrom(java.io.InputStream input)static VirtualServiceOuterClass.DestinationparseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static VirtualServiceOuterClass.DestinationparseFrom(java.nio.ByteBuffer data)static VirtualServiceOuterClass.DestinationparseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static com.google.protobuf.Parser<VirtualServiceOuterClass.Destination>parser()VirtualServiceOuterClass.Destination.BuildertoBuilder()voidwriteTo(com.google.protobuf.CodedOutputStream output)-
从类继承的方法 com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, 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, writeStringNoTag
-
从类继承的方法 com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
-
-
-
-
字段详细资料
-
serialVersionUID
private static final long serialVersionUID
- 另请参阅:
- 常量字段值
-
HOST_FIELD_NUMBER
public static final int HOST_FIELD_NUMBER
- 另请参阅:
- 常量字段值
-
host_
private volatile java.lang.Object host_
-
SUBSET_FIELD_NUMBER
public static final int SUBSET_FIELD_NUMBER
- 另请参阅:
- 常量字段值
-
subset_
private volatile java.lang.Object subset_
-
PORT_FIELD_NUMBER
public static final int PORT_FIELD_NUMBER
- 另请参阅:
- 常量字段值
-
port_
private VirtualServiceOuterClass.PortSelector port_
-
memoizedIsInitialized
private byte memoizedIsInitialized
-
DEFAULT_INSTANCE
private static final VirtualServiceOuterClass.Destination DEFAULT_INSTANCE
-
PARSER
private static final com.google.protobuf.Parser<VirtualServiceOuterClass.Destination> PARSER
-
-
方法详细资料
-
newInstance
protected java.lang.Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
- 覆盖:
newInstance在类中com.google.protobuf.GeneratedMessageV3
-
getUnknownFields
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
- 指定者:
getUnknownFields在接口中com.google.protobuf.MessageOrBuilder- 覆盖:
getUnknownFields在类中com.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- 指定者:
internalGetFieldAccessorTable在类中com.google.protobuf.GeneratedMessageV3
-
getHost
public java.lang.String getHost()
The name of a service from the service registry. Service names are looked up from the platform's service registry (e.g., Kubernetes services, Consul services, etc.) and from the hosts declared by [ServiceEntry](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry). Traffic forwarded to destinations that are not found in either of the two, will be dropped. *Note for Kubernetes users*: When short names are used (e.g. "reviews" instead of "reviews.default.svc.cluster.local"), Istio will interpret the short name based on the namespace of the rule, not the service. A rule in the "default" namespace containing a host "reviews will be interpreted as "reviews.default.svc.cluster.local", irrespective of the actual namespace associated with the reviews service. To avoid potential misconfiguration, it is recommended to always use fully qualified domain names over short names.
string host = 1 [(.google.api.field_behavior) = REQUIRED];- 指定者:
getHost在接口中VirtualServiceOuterClass.DestinationOrBuilder- 返回:
- The host.
-
getHostBytes
public com.google.protobuf.ByteString getHostBytes()
The name of a service from the service registry. Service names are looked up from the platform's service registry (e.g., Kubernetes services, Consul services, etc.) and from the hosts declared by [ServiceEntry](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry). Traffic forwarded to destinations that are not found in either of the two, will be dropped. *Note for Kubernetes users*: When short names are used (e.g. "reviews" instead of "reviews.default.svc.cluster.local"), Istio will interpret the short name based on the namespace of the rule, not the service. A rule in the "default" namespace containing a host "reviews will be interpreted as "reviews.default.svc.cluster.local", irrespective of the actual namespace associated with the reviews service. To avoid potential misconfiguration, it is recommended to always use fully qualified domain names over short names.
string host = 1 [(.google.api.field_behavior) = REQUIRED];- 指定者:
getHostBytes在接口中VirtualServiceOuterClass.DestinationOrBuilder- 返回:
- The bytes for host.
-
getSubset
public java.lang.String getSubset()
The name of a subset within the service. Applicable only to services within the mesh. The subset must be defined in a corresponding DestinationRule.
string subset = 2;- 指定者:
getSubset在接口中VirtualServiceOuterClass.DestinationOrBuilder- 返回:
- The subset.
-
getSubsetBytes
public com.google.protobuf.ByteString getSubsetBytes()
The name of a subset within the service. Applicable only to services within the mesh. The subset must be defined in a corresponding DestinationRule.
string subset = 2;- 指定者:
getSubsetBytes在接口中VirtualServiceOuterClass.DestinationOrBuilder- 返回:
- The bytes for subset.
-
hasPort
public boolean hasPort()
Specifies the port on the host that is being addressed. If a service exposes only a single port it is not required to explicitly select the port.
.istio.networking.v1alpha3.PortSelector port = 3;- 指定者:
hasPort在接口中VirtualServiceOuterClass.DestinationOrBuilder- 返回:
- Whether the port field is set.
-
getPort
public VirtualServiceOuterClass.PortSelector getPort()
Specifies the port on the host that is being addressed. If a service exposes only a single port it is not required to explicitly select the port.
.istio.networking.v1alpha3.PortSelector port = 3;- 指定者:
getPort在接口中VirtualServiceOuterClass.DestinationOrBuilder- 返回:
- The port.
-
getPortOrBuilder
public VirtualServiceOuterClass.PortSelectorOrBuilder getPortOrBuilder()
Specifies the port on the host that is being addressed. If a service exposes only a single port it is not required to explicitly select the port.
.istio.networking.v1alpha3.PortSelector port = 3;
-
isInitialized
public final boolean isInitialized()
- 指定者:
isInitialized在接口中com.google.protobuf.MessageLiteOrBuilder- 覆盖:
isInitialized在类中com.google.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException- 指定者:
writeTo在接口中com.google.protobuf.MessageLite- 覆盖:
writeTo在类中com.google.protobuf.GeneratedMessageV3- 抛出:
java.io.IOException
-
getSerializedSize
public int getSerializedSize()
- 指定者:
getSerializedSize在接口中com.google.protobuf.MessageLite- 覆盖:
getSerializedSize在类中com.google.protobuf.GeneratedMessageV3
-
equals
public boolean equals(java.lang.Object obj)
- 指定者:
equals在接口中com.google.protobuf.Message- 覆盖:
equals在类中com.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- 指定者:
hashCode在接口中com.google.protobuf.Message- 覆盖:
hashCode在类中com.google.protobuf.AbstractMessage
-
parseFrom
public static VirtualServiceOuterClass.Destination parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
- 抛出:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static VirtualServiceOuterClass.Destination parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- 抛出:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static VirtualServiceOuterClass.Destination parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
- 抛出:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static VirtualServiceOuterClass.Destination parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- 抛出:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static VirtualServiceOuterClass.Destination parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
- 抛出:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static VirtualServiceOuterClass.Destination parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- 抛出:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static VirtualServiceOuterClass.Destination parseFrom(java.io.InputStream input) throws java.io.IOException
- 抛出:
java.io.IOException
-
parseFrom
public static VirtualServiceOuterClass.Destination parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- 抛出:
java.io.IOException
-
parseDelimitedFrom
public static VirtualServiceOuterClass.Destination parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
- 抛出:
java.io.IOException
-
parseDelimitedFrom
public static VirtualServiceOuterClass.Destination parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- 抛出:
java.io.IOException
-
parseFrom
public static VirtualServiceOuterClass.Destination parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
- 抛出:
java.io.IOException
-
parseFrom
public static VirtualServiceOuterClass.Destination parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
- 抛出:
java.io.IOException
-
newBuilderForType
public VirtualServiceOuterClass.Destination.Builder newBuilderForType()
- 指定者:
newBuilderForType在接口中com.google.protobuf.Message- 指定者:
newBuilderForType在接口中com.google.protobuf.MessageLite
-
newBuilder
public static VirtualServiceOuterClass.Destination.Builder newBuilder()
-
newBuilder
public static VirtualServiceOuterClass.Destination.Builder newBuilder(VirtualServiceOuterClass.Destination prototype)
-
toBuilder
public VirtualServiceOuterClass.Destination.Builder toBuilder()
- 指定者:
toBuilder在接口中com.google.protobuf.Message- 指定者:
toBuilder在接口中com.google.protobuf.MessageLite
-
newBuilderForType
protected VirtualServiceOuterClass.Destination.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
- 指定者:
newBuilderForType在类中com.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
public static VirtualServiceOuterClass.Destination getDefaultInstance()
-
parser
public static com.google.protobuf.Parser<VirtualServiceOuterClass.Destination> parser()
-
getParserForType
public com.google.protobuf.Parser<VirtualServiceOuterClass.Destination> getParserForType()
- 指定者:
getParserForType在接口中com.google.protobuf.Message- 指定者:
getParserForType在接口中com.google.protobuf.MessageLite- 覆盖:
getParserForType在类中com.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public VirtualServiceOuterClass.Destination getDefaultInstanceForType()
- 指定者:
getDefaultInstanceForType在接口中com.google.protobuf.MessageLiteOrBuilder- 指定者:
getDefaultInstanceForType在接口中com.google.protobuf.MessageOrBuilder
-
-