类 VirtualServiceOuterClass.Destination

  • 所有已实现的接口:
    com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, VirtualServiceOuterClass.DestinationOrBuilder, java.io.Serializable
    封闭类:
    VirtualServiceOuterClass

    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 type istio.networking.v1alpha3.Destination
    另请参阅:
    序列化表格
    • 构造器详细资料

      • Destination

        private Destination​(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)
      • Destination

        private Destination()
    • 方法详细资料

      • 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.
      • 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,
                                                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                                              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,
                                                                     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
      • newBuilderForType

        protected VirtualServiceOuterClass.Destination.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        指定者:
        newBuilderForType 在类中 com.google.protobuf.GeneratedMessageV3
      • 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