traffic

package
v0.0.0-...-ac5cff2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the OpenSergo traffic-router v1alpha1 CRD. +kubebuilder:object:generate=true +groupName=traffic.opensergo.io +versionName=v1alpha1

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "traffic.opensergo.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var (
	HTTPRedirect_RedirectPortSelection_name = map[int32]string{
		0: "FROM_PROTOCOL_DEFAULT",
		1: "FROM_REQUEST_PORT",
	}
	HTTPRedirect_RedirectPortSelection_value = map[string]int32{
		"FROM_PROTOCOL_DEFAULT": 0,
		"FROM_REQUEST_PORT":     1,
	}
)

Enum value maps for HTTPRedirect_RedirectPortSelection.

View Source
var File_traffic_v1alpha1_traffic_router_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type CorsPolicy

type CorsPolicy struct {

	// The list of origins that are allowed to perform CORS requests. The
	// content will be serialized into the Access-Control-Allow-Origin
	// header. Wildcard * will allow all origins.
	// $hide_from_docs
	//
	// Deprecated: Do not use.
	AllowOrigin []string `protobuf:"bytes,1,rep,name=allow_origin,json=allowOrigin,proto3" json:"allow_origin,omitempty"`
	// String patterns that match allowed origins.
	// An origin is allowed if any of the string matchers match.
	// If a match is found, then the outgoing Access-Control-Allow-Origin would be set to the origin as provided by the client.
	AllowOrigins []*StringMatch `protobuf:"bytes,7,rep,name=allow_origins,json=allowOrigins,proto3" json:"allow_origins,omitempty"`
	// List of HTTP methods allowed to access the resource. The content will
	// be serialized into the Access-Control-Allow-Methods header.
	AllowMethods []string `protobuf:"bytes,2,rep,name=allow_methods,json=allowMethods,proto3" json:"allow_methods,omitempty"`
	// List of HTTP headers that can be used when requesting the
	// resource. Serialized to Access-Control-Allow-Headers header.
	AllowHeaders []string `protobuf:"bytes,3,rep,name=allow_headers,json=allowHeaders,proto3" json:"allow_headers,omitempty"`
	// A list of HTTP headers that the browsers are allowed to
	// access. Serialized into Access-Control-Expose-Headers header.
	ExposeHeaders []string `protobuf:"bytes,4,rep,name=expose_headers,json=exposeHeaders,proto3" json:"expose_headers,omitempty"`
	// Specifies how long the results of a preflight request can be
	// cached. Translates to the `Access-Control-Max-Age` header.
	MaxAge *duration.Duration `protobuf:"bytes,5,opt,name=max_age,json=maxAge,proto3" json:"max_age,omitempty"`
	// Indicates whether the caller is allowed to send the actual request
	// (not the preflight) using credentials. Translates to
	// `Access-Control-Allow-Credentials` header.
	AllowCredentials *wrappers.BoolValue `protobuf:"bytes,6,opt,name=allow_credentials,json=allowCredentials,proto3" json:"allow_credentials,omitempty"`
	// contains filtered or unexported fields
}

Describes the Cross-Origin Resource Sharing (CORS) policy, for a given service. Refer to [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) for further details about cross origin resource sharing. For example, the following rule restricts cross origin requests to those originating from example.com domain using HTTP POST/GET, and sets the `Access-Control-Allow-Credentials` header to false. In addition, it only exposes `X-Foo-bar` header and sets an expiry period of 1 day.

{{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- route:
  - destination:
      host: ratings.prod.svc.cluster.local
      subset: v1
  corsPolicy:
    allowOrigins:
    - exact: https://example.com
    allowMethods:
    - POST
    - GET
    allowCredentials: false
    allowHeaders:
    - X-Foo-Bar
    maxAge: "24h"

``` {{</tab>}}

{{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- route:
  - destination:
      host: ratings.prod.svc.cluster.local
      subset: v1
  corsPolicy:
    allowOrigins:
    - exact: https://example.com
    allowMethods:
    - POST
    - GET
    allowCredentials: false
    allowHeaders:
    - X-Foo-Bar
    maxAge: "24h"

``` {{</tab>}} {{</tabset>}}

func (*CorsPolicy) DeepCopy

func (in *CorsPolicy) DeepCopy() *CorsPolicy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorsPolicy. Required by controller-gen.

func (*CorsPolicy) DeepCopyInterface

func (in *CorsPolicy) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new CorsPolicy. Required by controller-gen.

func (*CorsPolicy) DeepCopyInto

func (in *CorsPolicy) DeepCopyInto(out *CorsPolicy)

DeepCopyInto supports using CorsPolicy within kubernetes types, where deepcopy-gen is used.

func (*CorsPolicy) Descriptor deprecated

func (*CorsPolicy) Descriptor() ([]byte, []int)

Deprecated: Use CorsPolicy.ProtoReflect.Descriptor instead.

func (*CorsPolicy) GetAllowCredentials

func (x *CorsPolicy) GetAllowCredentials() *wrappers.BoolValue

func (*CorsPolicy) GetAllowHeaders

func (x *CorsPolicy) GetAllowHeaders() []string

func (*CorsPolicy) GetAllowMethods

func (x *CorsPolicy) GetAllowMethods() []string

func (*CorsPolicy) GetAllowOrigin deprecated

func (x *CorsPolicy) GetAllowOrigin() []string

Deprecated: Do not use.

func (*CorsPolicy) GetAllowOrigins

func (x *CorsPolicy) GetAllowOrigins() []*StringMatch

func (*CorsPolicy) GetExposeHeaders

func (x *CorsPolicy) GetExposeHeaders() []string

func (*CorsPolicy) GetMaxAge

func (x *CorsPolicy) GetMaxAge() *duration.Duration

func (*CorsPolicy) ProtoMessage

func (*CorsPolicy) ProtoMessage()

func (*CorsPolicy) ProtoReflect

func (x *CorsPolicy) ProtoReflect() protoreflect.Message

func (*CorsPolicy) Reset

func (x *CorsPolicy) Reset()

func (*CorsPolicy) String

func (x *CorsPolicy) String() string

type Delegate

type Delegate struct {

	// Name specifies the name of the delegate VirtualService.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Namespace specifies the namespace where the delegate VirtualService resides.
	// By default, it is same to the root's.
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// contains filtered or unexported fields
}

Describes the delegate VirtualService. The following routing rules forward the traffic to `/productpage` by a delegate VirtualService named `productpage`, forward the traffic to `/reviews` by a delegate VirtualService named `reviews`.

```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: bookinfo

spec:

hosts:
- "bookinfo.com"
gateways:
- mygateway
http:
- match:
  - uri:
      prefix: "/productpage"
  delegate:
     name: productpage
     namespace: nsA
- match:
  - uri:
      prefix: "/reviews"
  delegate:
      name: reviews
      namespace: nsB

```

```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: productpage
namespace: nsA

spec:

http:
- match:
   - uri:
      prefix: "/productpage/v1/"
  route:
  - destination:
      host: productpage-v1.nsA.svc.cluster.local
- route:
  - destination:
      host: productpage.nsA.svc.cluster.local

```

```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: reviews
namespace: nsB

spec:

http:
- route:
  - destination:
      host: reviews.nsB.svc.cluster.local

```

func (*Delegate) DeepCopy

func (in *Delegate) DeepCopy() *Delegate

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Delegate. Required by controller-gen.

func (*Delegate) DeepCopyInterface

func (in *Delegate) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new Delegate. Required by controller-gen.

func (*Delegate) DeepCopyInto

func (in *Delegate) DeepCopyInto(out *Delegate)

DeepCopyInto supports using Delegate within kubernetes types, where deepcopy-gen is used.

func (*Delegate) Descriptor deprecated

func (*Delegate) Descriptor() ([]byte, []int)

Deprecated: Use Delegate.ProtoReflect.Descriptor instead.

func (*Delegate) GetName

func (x *Delegate) GetName() string

func (*Delegate) GetNamespace

func (x *Delegate) GetNamespace() string

func (*Delegate) ProtoMessage

func (*Delegate) ProtoMessage()

func (*Delegate) ProtoReflect

func (x *Delegate) ProtoReflect() protoreflect.Message

func (*Delegate) Reset

func (x *Delegate) Reset()

func (*Delegate) String

func (x *Delegate) String() string

type Destination

type Destination struct {

	// 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.
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	// The name of a subset within the service. Applicable only to services
	// within the mesh. The subset must be defined in a corresponding
	// DestinationRule.
	Subset string `protobuf:"bytes,2,opt,name=subset,proto3" json:"subset,omitempty"`
	// 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.
	Port     *PortSelector `protobuf:"bytes,3,opt,name=port,proto3" json:"port,omitempty"`
	Fallback *Fallback     `protobuf:"bytes,4,opt,name=fallback,proto3" json:"fallback,omitempty"`
	// contains filtered or unexported fields
}

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/v1beta1 kind: VirtualService metadata:

name: my-wiki-rule

spec:

hosts:
- wikipedia.org
http:
- timeout: 5s
  route:
  - destination:
      host: wikipedia.org

``` {{</tab>}} {{</tabset>}}

func (*Destination) DeepCopy

func (in *Destination) DeepCopy() *Destination

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination. Required by controller-gen.

func (*Destination) DeepCopyInterface

func (in *Destination) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new Destination. Required by controller-gen.

func (*Destination) DeepCopyInto

func (in *Destination) DeepCopyInto(out *Destination)

DeepCopyInto supports using Destination within kubernetes types, where deepcopy-gen is used.

func (*Destination) Descriptor deprecated

func (*Destination) Descriptor() ([]byte, []int)

Deprecated: Use Destination.ProtoReflect.Descriptor instead.

func (*Destination) GetFallback

func (x *Destination) GetFallback() *Fallback

func (*Destination) GetHost

func (x *Destination) GetHost() string

func (*Destination) GetPort

func (x *Destination) GetPort() *PortSelector

func (*Destination) GetSubset

func (x *Destination) GetSubset() string

func (*Destination) ProtoMessage

func (*Destination) ProtoMessage()

func (*Destination) ProtoReflect

func (x *Destination) ProtoReflect() protoreflect.Message

func (*Destination) Reset

func (x *Destination) Reset()

func (*Destination) String

func (x *Destination) String() string

type Fallback

type Fallback struct {
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	// The name of a subset within the service. Applicable only to services
	// within the mesh. The subset must be defined in a corresponding
	// DestinationRule.
	Subset string `protobuf:"bytes,2,opt,name=subset,proto3" json:"subset,omitempty"`
	// contains filtered or unexported fields
}

func (*Fallback) DeepCopy

func (in *Fallback) DeepCopy() *Fallback

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Fallback. Required by controller-gen.

func (*Fallback) DeepCopyInterface

func (in *Fallback) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new Fallback. Required by controller-gen.

func (*Fallback) DeepCopyInto

func (in *Fallback) DeepCopyInto(out *Fallback)

DeepCopyInto supports using Fallback within kubernetes types, where deepcopy-gen is used.

func (*Fallback) Descriptor deprecated

func (*Fallback) Descriptor() ([]byte, []int)

Deprecated: Use Fallback.ProtoReflect.Descriptor instead.

func (*Fallback) GetHost

func (x *Fallback) GetHost() string

func (*Fallback) GetSubset

func (x *Fallback) GetSubset() string

func (*Fallback) ProtoMessage

func (*Fallback) ProtoMessage()

func (*Fallback) ProtoReflect

func (x *Fallback) ProtoReflect() protoreflect.Message

func (*Fallback) Reset

func (x *Fallback) Reset()

func (*Fallback) String

func (x *Fallback) String() string

type HTTPBody

type HTTPBody struct {

	// Types that are assignable to Specifier:
	//	*HTTPBody_String_
	//	*HTTPBody_Bytes
	Specifier isHTTPBody_Specifier `protobuf_oneof:"specifier"`
	// contains filtered or unexported fields
}

func (*HTTPBody) DeepCopy

func (in *HTTPBody) DeepCopy() *HTTPBody

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPBody. Required by controller-gen.

func (*HTTPBody) DeepCopyInterface

func (in *HTTPBody) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new HTTPBody. Required by controller-gen.

func (*HTTPBody) DeepCopyInto

func (in *HTTPBody) DeepCopyInto(out *HTTPBody)

DeepCopyInto supports using HTTPBody within kubernetes types, where deepcopy-gen is used.

func (*HTTPBody) Descriptor deprecated

func (*HTTPBody) Descriptor() ([]byte, []int)

Deprecated: Use HTTPBody.ProtoReflect.Descriptor instead.

func (*HTTPBody) GetBytes

func (x *HTTPBody) GetBytes() []byte

func (*HTTPBody) GetSpecifier

func (m *HTTPBody) GetSpecifier() isHTTPBody_Specifier

func (*HTTPBody) GetString_

func (x *HTTPBody) GetString_() string

func (*HTTPBody) ProtoMessage

func (*HTTPBody) ProtoMessage()

func (*HTTPBody) ProtoReflect

func (x *HTTPBody) ProtoReflect() protoreflect.Message

func (*HTTPBody) Reset

func (x *HTTPBody) Reset()

func (*HTTPBody) String

func (x *HTTPBody) String() string

type HTTPBody_Bytes

type HTTPBody_Bytes struct {
	// response body as base64 encoded bytes.
	Bytes []byte `protobuf:"bytes,2,opt,name=bytes,proto3,oneof"`
}

type HTTPBody_String_

type HTTPBody_String_ struct {
	// response body as a string
	String_ string `protobuf:"bytes,1,opt,name=string,proto3,oneof"`
}

type HTTPDirectResponse

type HTTPDirectResponse struct {

	// Specifies the HTTP response status to be returned.
	Status uint32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
	// Specifies the content of the response body. If this setting is omitted,
	// no body is included in the generated response.
	Body *HTTPBody `protobuf:"bytes,2,opt,name=body,proto3" json:"body,omitempty"`
	// contains filtered or unexported fields
}

HTTPDirectResponse can be used to send a fixed response to clients. For example, the following rule returns a fixed 503 status with a body to requests for /v1/getProductRatings API.

{{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- match:
  - uri:
      exact: /v1/getProductRatings
  directResponse:
    status: 503
    body:
      string: "unknown error"
...

``` {{</tab>}}

{{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- match:
  - uri:
      exact: /v1/getProductRatings
  directResponse:
    status: 503
    body:
      string: "unknown error"
...

``` {{</tab>}} {{</tabset>}}

It is also possible to specify a binary response body. This is mostly useful for non text-based protocols such as gRPC.

{{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- match:
  - uri:
      exact: /v1/getProductRatings
  directResponse:
    status: 503
    body:
      bytes: "dW5rbm93biBlcnJvcg==" # "unknown error" in base64
...

``` {{</tab>}}

{{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- match:
  - uri:
      exact: /v1/getProductRatings
  directResponse:
    status: 503
    body:
      bytes: "dW5rbm93biBlcnJvcg==" # "unknown error" in base64
...

``` {{</tab>}} {{</tabset>}}

It is good practice to add headers in the HTTPRoute as well as the direct_response, for example to specify the returned Content-Type.

{{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- match:
  - uri:
      exact: /v1/getProductRatings
  directResponse:
    status: 503
    body:
      string: "{\"error\": \"unknown error\"}"
  headers:
    response:
      set:
        content-type: "appliation/json"
...

``` {{</tab>}}

{{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- match:
  - uri:
      exact: /v1/getProductRatings
  directResponse:
    status: 503
    body:
      string: "{\"error\": \"unknown error\"}"
  headers:
    response:
      set:
        content-type: "text/plain"
...

``` {{</tab>}} {{</tabset>}}

func (*HTTPDirectResponse) DeepCopy

func (in *HTTPDirectResponse) DeepCopy() *HTTPDirectResponse

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPDirectResponse. Required by controller-gen.

func (*HTTPDirectResponse) DeepCopyInterface

func (in *HTTPDirectResponse) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new HTTPDirectResponse. Required by controller-gen.

func (*HTTPDirectResponse) DeepCopyInto

func (in *HTTPDirectResponse) DeepCopyInto(out *HTTPDirectResponse)

DeepCopyInto supports using HTTPDirectResponse within kubernetes types, where deepcopy-gen is used.

func (*HTTPDirectResponse) Descriptor deprecated

func (*HTTPDirectResponse) Descriptor() ([]byte, []int)

Deprecated: Use HTTPDirectResponse.ProtoReflect.Descriptor instead.

func (*HTTPDirectResponse) GetBody

func (x *HTTPDirectResponse) GetBody() *HTTPBody

func (*HTTPDirectResponse) GetStatus

func (x *HTTPDirectResponse) GetStatus() uint32

func (*HTTPDirectResponse) ProtoMessage

func (*HTTPDirectResponse) ProtoMessage()

func (*HTTPDirectResponse) ProtoReflect

func (x *HTTPDirectResponse) ProtoReflect() protoreflect.Message

func (*HTTPDirectResponse) Reset

func (x *HTTPDirectResponse) Reset()

func (*HTTPDirectResponse) String

func (x *HTTPDirectResponse) String() string

type HTTPFaultInjection

type HTTPFaultInjection struct {

	// Delay requests before forwarding, emulating various failures such as
	// network issues, overloaded upstream service, etc.
	Delay *HTTPFaultInjection_Delay `protobuf:"bytes,1,opt,name=delay,proto3" json:"delay,omitempty"`
	// Abort Http request attempts and return error codes back to downstream
	// service, giving the impression that the upstream service is faulty.
	Abort *HTTPFaultInjection_Abort `protobuf:"bytes,2,opt,name=abort,proto3" json:"abort,omitempty"`
	// contains filtered or unexported fields
}

HTTPFaultInjection can be used to specify one or more faults to inject while forwarding HTTP requests to the destination specified in a route. Fault specification is part of a VirtualService rule. Faults include aborting the Http request from downstream service, and/or delaying proxying of requests. A fault rule MUST HAVE delay or abort or both.

*Note:* Delay and abort faults are independent of one another, even if both are specified simultaneously.

func (*HTTPFaultInjection) DeepCopy

func (in *HTTPFaultInjection) DeepCopy() *HTTPFaultInjection

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPFaultInjection. Required by controller-gen.

func (*HTTPFaultInjection) DeepCopyInterface

func (in *HTTPFaultInjection) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new HTTPFaultInjection. Required by controller-gen.

func (*HTTPFaultInjection) DeepCopyInto

func (in *HTTPFaultInjection) DeepCopyInto(out *HTTPFaultInjection)

DeepCopyInto supports using HTTPFaultInjection within kubernetes types, where deepcopy-gen is used.

func (*HTTPFaultInjection) Descriptor deprecated

func (*HTTPFaultInjection) Descriptor() ([]byte, []int)

Deprecated: Use HTTPFaultInjection.ProtoReflect.Descriptor instead.

func (*HTTPFaultInjection) GetAbort

func (*HTTPFaultInjection) GetDelay

func (*HTTPFaultInjection) ProtoMessage

func (*HTTPFaultInjection) ProtoMessage()

func (*HTTPFaultInjection) ProtoReflect

func (x *HTTPFaultInjection) ProtoReflect() protoreflect.Message

func (*HTTPFaultInjection) Reset

func (x *HTTPFaultInjection) Reset()

func (*HTTPFaultInjection) String

func (x *HTTPFaultInjection) String() string

type HTTPFaultInjection_Abort

type HTTPFaultInjection_Abort struct {

	// Types that are assignable to ErrorType:
	//	*HTTPFaultInjection_Abort_HttpStatus
	//	*HTTPFaultInjection_Abort_GrpcStatus
	//	*HTTPFaultInjection_Abort_Http2Error
	ErrorType isHTTPFaultInjection_Abort_ErrorType `protobuf_oneof:"error_type"`
	// Percentage of requests to be aborted with the error code provided.
	// If not specified, no request will be aborted.
	Percentage *Percent `protobuf:"bytes,5,opt,name=percentage,proto3" json:"percentage,omitempty"`
	// contains filtered or unexported fields
}

Abort specification is used to prematurely abort a request with a pre-specified error code. The following example will return an HTTP 400 error code for 1 out of every 1000 requests to the "ratings" service "v1".

{{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- route:
  - destination:
      host: ratings.prod.svc.cluster.local
      subset: v1
  fault:
    abort:
      percentage:
        value: 0.1
      httpStatus: 400

``` {{</tab>}}

{{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- route:
  - destination:
      host: ratings.prod.svc.cluster.local
      subset: v1
  fault:
    abort:
      percentage:
        value: 0.1
      httpStatus: 400

``` {{</tab>}} {{</tabset>}}

The _httpStatus_ field is used to indicate the HTTP status code to return to the caller. The optional _percentage_ field can be used to only abort a certain percentage of requests. If not specified, no request will be aborted.

func (*HTTPFaultInjection_Abort) Descriptor deprecated

func (*HTTPFaultInjection_Abort) Descriptor() ([]byte, []int)

Deprecated: Use HTTPFaultInjection_Abort.ProtoReflect.Descriptor instead.

func (*HTTPFaultInjection_Abort) GetErrorType

func (m *HTTPFaultInjection_Abort) GetErrorType() isHTTPFaultInjection_Abort_ErrorType

func (*HTTPFaultInjection_Abort) GetGrpcStatus

func (x *HTTPFaultInjection_Abort) GetGrpcStatus() string

func (*HTTPFaultInjection_Abort) GetHttp2Error

func (x *HTTPFaultInjection_Abort) GetHttp2Error() string

func (*HTTPFaultInjection_Abort) GetHttpStatus

func (x *HTTPFaultInjection_Abort) GetHttpStatus() int32

func (*HTTPFaultInjection_Abort) GetPercentage

func (x *HTTPFaultInjection_Abort) GetPercentage() *Percent

func (*HTTPFaultInjection_Abort) ProtoMessage

func (*HTTPFaultInjection_Abort) ProtoMessage()

func (*HTTPFaultInjection_Abort) ProtoReflect

func (x *HTTPFaultInjection_Abort) ProtoReflect() protoreflect.Message

func (*HTTPFaultInjection_Abort) Reset

func (x *HTTPFaultInjection_Abort) Reset()

func (*HTTPFaultInjection_Abort) String

func (x *HTTPFaultInjection_Abort) String() string

type HTTPFaultInjection_Abort_GrpcStatus

type HTTPFaultInjection_Abort_GrpcStatus struct {
	// GRPC status code to use to abort the request. The supported
	// codes are documented in https://github.com/grpc/grpc/blob/master/doc/statuscodes.md
	// Note: If you want to return the status "Unavailable", then you should
	// specify the code as `UNAVAILABLE`(all caps), but not `14`.
	GrpcStatus string `protobuf:"bytes,3,opt,name=grpc_status,json=grpcStatus,proto3,oneof"`
}

type HTTPFaultInjection_Abort_Http2Error

type HTTPFaultInjection_Abort_Http2Error struct {
	// $hide_from_docs
	Http2Error string `protobuf:"bytes,4,opt,name=http2_error,json=http2Error,proto3,oneof"`
}

type HTTPFaultInjection_Abort_HttpStatus

type HTTPFaultInjection_Abort_HttpStatus struct {
	// HTTP status code to use to abort the Http request.
	HttpStatus int32 `protobuf:"varint,2,opt,name=http_status,json=httpStatus,proto3,oneof"`
}

type HTTPFaultInjection_Delay

type HTTPFaultInjection_Delay struct {

	// Percentage of requests on which the delay will be injected (0-100).
	// Use of integer `percent` value is deprecated. Use the double `percentage`
	// field instead.
	//
	// Deprecated: Do not use.
	Percent int32 `protobuf:"varint,1,opt,name=percent,proto3" json:"percent,omitempty"`
	// Types that are assignable to HttpDelayType:
	//	*HTTPFaultInjection_Delay_FixedDelay
	//	*HTTPFaultInjection_Delay_ExponentialDelay
	HttpDelayType isHTTPFaultInjection_Delay_HttpDelayType `protobuf_oneof:"http_delay_type"`
	// Percentage of requests on which the delay will be injected.
	// If left unspecified, no request will be delayed.
	Percentage *Percent `protobuf:"bytes,5,opt,name=percentage,proto3" json:"percentage,omitempty"`
	// contains filtered or unexported fields
}

Delay specification is used to inject latency into the request forwarding path. The following example will introduce a 5 second delay in 1 out of every 1000 requests to the "v1" version of the "reviews" service from all pods with label env: prod

{{<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:
- match:
  - sourceLabels:
      env: prod
  route:
  - destination:
      host: reviews.prod.svc.cluster.local
      subset: v1
  fault:
    delay:
      percentage:
        value: 0.1
      fixedDelay: 5s

``` {{</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:
- match:
  - sourceLabels:
      env: prod
  route:
  - destination:
      host: reviews.prod.svc.cluster.local
      subset: v1
  fault:
    delay:
      percentage:
        value: 0.1
      fixedDelay: 5s

``` {{</tab>}} {{</tabset>}}

The _fixedDelay_ field is used to indicate the amount of delay in seconds. The optional _percentage_ field can be used to only delay a certain percentage of requests. If left unspecified, no request will be delayed.

func (*HTTPFaultInjection_Delay) Descriptor deprecated

func (*HTTPFaultInjection_Delay) Descriptor() ([]byte, []int)

Deprecated: Use HTTPFaultInjection_Delay.ProtoReflect.Descriptor instead.

func (*HTTPFaultInjection_Delay) GetExponentialDelay

func (x *HTTPFaultInjection_Delay) GetExponentialDelay() *duration.Duration

func (*HTTPFaultInjection_Delay) GetFixedDelay

func (x *HTTPFaultInjection_Delay) GetFixedDelay() *duration.Duration

func (*HTTPFaultInjection_Delay) GetHttpDelayType

func (m *HTTPFaultInjection_Delay) GetHttpDelayType() isHTTPFaultInjection_Delay_HttpDelayType

func (*HTTPFaultInjection_Delay) GetPercent deprecated

func (x *HTTPFaultInjection_Delay) GetPercent() int32

Deprecated: Do not use.

func (*HTTPFaultInjection_Delay) GetPercentage

func (x *HTTPFaultInjection_Delay) GetPercentage() *Percent

func (*HTTPFaultInjection_Delay) ProtoMessage

func (*HTTPFaultInjection_Delay) ProtoMessage()

func (*HTTPFaultInjection_Delay) ProtoReflect

func (x *HTTPFaultInjection_Delay) ProtoReflect() protoreflect.Message

func (*HTTPFaultInjection_Delay) Reset

func (x *HTTPFaultInjection_Delay) Reset()

func (*HTTPFaultInjection_Delay) String

func (x *HTTPFaultInjection_Delay) String() string

type HTTPFaultInjection_Delay_ExponentialDelay

type HTTPFaultInjection_Delay_ExponentialDelay struct {
	// $hide_from_docs
	ExponentialDelay *duration.Duration `protobuf:"bytes,3,opt,name=exponential_delay,json=exponentialDelay,proto3,oneof"`
}

type HTTPFaultInjection_Delay_FixedDelay

type HTTPFaultInjection_Delay_FixedDelay struct {
	// Add a fixed delay before forwarding the request. Format:
	// 1h/1m/1s/1ms. MUST be >=1ms.
	FixedDelay *duration.Duration `protobuf:"bytes,2,opt,name=fixed_delay,json=fixedDelay,proto3,oneof"`
}

type HTTPMatchRequest

type HTTPMatchRequest struct {

	// The name assigned to a match. The match's name will be
	// concatenated with the parent route's name and will be logged in
	// the access logs for requests matching this route.
	Name string `protobuf:"bytes,11,opt,name=name,proto3" json:"name,omitempty"`
	// URI to match
	// values are case-sensitive and formatted as follows:
	//
	// - `exact: "value"` for exact string match
	//
	// - `prefix: "value"` for prefix-based match
	//
	// - `regex: "value"` for RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).
	//
	// **Note:** Case-insensitive matching could be enabled via the
	// `ignore_uri_case` flag.
	Uri *StringMatch `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
	// URI Scheme
	// values are case-sensitive and formatted as follows:
	//
	// - `exact: "value"` for exact string match
	//
	// - `prefix: "value"` for prefix-based match
	//
	// - `regex: "value"` for RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).
	//
	Scheme *StringMatch `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"`
	// HTTP Method
	// values are case-sensitive and formatted as follows:
	//
	// - `exact: "value"` for exact string match
	//
	// - `prefix: "value"` for prefix-based match
	//
	// - `regex: "value"` for RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).
	//
	Method *StringMatch `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"`
	// HTTP Authority
	// values are case-sensitive and formatted as follows:
	//
	// - `exact: "value"` for exact string match
	//
	// - `prefix: "value"` for prefix-based match
	//
	// - `regex: "value"` for RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).
	//
	Authority *StringMatch `protobuf:"bytes,4,opt,name=authority,proto3" json:"authority,omitempty"`
	// The header keys must be lowercase and use hyphen as the separator,
	// e.g. _x-request-id_.
	//
	// Header values are case-sensitive and formatted as follows:
	//
	// - `exact: "value"` for exact string match
	//
	// - `prefix: "value"` for prefix-based match
	//
	// - `regex: "value"` for RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).
	//
	// If the value is empty and only the name of header is specfied, presence of the header is checked.
	// **Note:** The keys `uri`, `scheme`, `method`, and `authority` will be ignored.
	Headers map[string]*StringMatch `` /* 155-byte string literal not displayed */
	// Specifies the ports on the host that is being addressed. Many services
	// only expose a single port or label ports with the protocols they support,
	// in these cases it is not required to explicitly select the port.
	Port uint32 `protobuf:"varint,6,opt,name=port,proto3" json:"port,omitempty"`
	// One or more labels that constrain the applicability of a rule to source (client) workloads
	// with the given labels. If the VirtualService has a list of gateways specified
	// in the top-level `gateways` field, it must include the reserved gateway
	// `mesh` for this field to be applicable.
	SourceLabels map[string]string `` /* 185-byte string literal not displayed */
	// Names of gateways where the rule should be applied. Gateway names
	// in the top-level `gateways` field of the VirtualService (if any) are overridden. The gateway
	// match is independent of sourceLabels.
	Gateways []string `protobuf:"bytes,8,rep,name=gateways,proto3" json:"gateways,omitempty"`
	// Query parameters for matching.
	//
	// Ex:
	//
	// - For a query parameter like "?key=true", the map key would be "key" and
	//   the string match could be defined as `exact: "true"`.
	//
	// - For a query parameter like "?key", the map key would be "key" and the
	//   string match could be defined as `exact: ""`.
	//
	// - For a query parameter like "?key=123", the map key would be "key" and the
	//   string match could be defined as `regex: "\d+$"`. Note that this
	//   configuration will only match values like "123" but not "a123" or "123a".
	//
	// **Note:** `prefix` matching is currently not supported.
	QueryParams map[string]*StringMatch `` /* 182-byte string literal not displayed */
	// Flag to specify whether the URI matching should be case-insensitive.
	//
	// **Note:** The case will be ignored only in the case of `exact` and `prefix`
	// URI matches.
	IgnoreUriCase bool `protobuf:"varint,10,opt,name=ignore_uri_case,json=ignoreUriCase,proto3" json:"ignore_uri_case,omitempty"`
	// withoutHeader has the same syntax with the header, but has opposite meaning.
	// If a header is matched with a matching rule among withoutHeader, the traffic becomes not matched one.
	WithoutHeaders map[string]*StringMatch `` /* 192-byte string literal not displayed */
	// Source namespace constraining the applicability of a rule to workloads in that namespace.
	// If the VirtualService has a list of gateways specified in the top-level `gateways` field,
	// it must include the reserved gateway `mesh` for this field to be applicable.
	SourceNamespace string `protobuf:"bytes,13,opt,name=source_namespace,json=sourceNamespace,proto3" json:"source_namespace,omitempty"`
	// The human readable prefix to use when emitting statistics for this route.
	// The statistics are generated with prefix route.<stat_prefix>.
	// This should be set for highly critical routes that one wishes to get "per-route" statistics on.
	// This prefix is only for proxy-level statistics (envoy_*) and not service-level (istio_*) statistics.
	// Refer to https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#envoy-v3-api-field-config-route-v3-route-stat-prefix
	// for statistics that are generated when this is configured.
	StatPrefix string `protobuf:"bytes,14,opt,name=stat_prefix,json=statPrefix,proto3" json:"stat_prefix,omitempty"`
	// contains filtered or unexported fields
}

HttpMatchRequest specifies a set of criterion to be met in order for the rule to be applied to the HTTP request. For example, the following restricts the rule to match only requests where the URL path starts with /ratings/v2/ and the request contains a custom `end-user` header with value `jason`.

{{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- match:
  - headers:
      end-user:
        exact: jason
    uri:
      prefix: "/ratings/v2/"
    ignoreUriCase: true
  route:
  - destination:
      host: ratings.prod.svc.cluster.local

``` {{</tab>}}

{{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- match:
  - headers:
      end-user:
        exact: jason
    uri:
      prefix: "/ratings/v2/"
    ignoreUriCase: true
  route:
  - destination:
      host: ratings.prod.svc.cluster.local

``` {{</tab>}} {{</tabset>}}

HTTPMatchRequest CANNOT be empty. **Note:** No regex string match can be set when delegate VirtualService is specified.

func (*HTTPMatchRequest) DeepCopy

func (in *HTTPMatchRequest) DeepCopy() *HTTPMatchRequest

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPMatchRequest. Required by controller-gen.

func (*HTTPMatchRequest) DeepCopyInterface

func (in *HTTPMatchRequest) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new HTTPMatchRequest. Required by controller-gen.

func (*HTTPMatchRequest) DeepCopyInto

func (in *HTTPMatchRequest) DeepCopyInto(out *HTTPMatchRequest)

DeepCopyInto supports using HTTPMatchRequest within kubernetes types, where deepcopy-gen is used.

func (*HTTPMatchRequest) Descriptor deprecated

func (*HTTPMatchRequest) Descriptor() ([]byte, []int)

Deprecated: Use HTTPMatchRequest.ProtoReflect.Descriptor instead.

func (*HTTPMatchRequest) GetAuthority

func (x *HTTPMatchRequest) GetAuthority() *StringMatch

func (*HTTPMatchRequest) GetGateways

func (x *HTTPMatchRequest) GetGateways() []string

func (*HTTPMatchRequest) GetHeaders

func (x *HTTPMatchRequest) GetHeaders() map[string]*StringMatch

func (*HTTPMatchRequest) GetIgnoreUriCase

func (x *HTTPMatchRequest) GetIgnoreUriCase() bool

func (*HTTPMatchRequest) GetMethod

func (x *HTTPMatchRequest) GetMethod() *StringMatch

func (*HTTPMatchRequest) GetName

func (x *HTTPMatchRequest) GetName() string

func (*HTTPMatchRequest) GetPort

func (x *HTTPMatchRequest) GetPort() uint32

func (*HTTPMatchRequest) GetQueryParams

func (x *HTTPMatchRequest) GetQueryParams() map[string]*StringMatch

func (*HTTPMatchRequest) GetScheme

func (x *HTTPMatchRequest) GetScheme() *StringMatch

func (*HTTPMatchRequest) GetSourceLabels

func (x *HTTPMatchRequest) GetSourceLabels() map[string]string

func (*HTTPMatchRequest) GetSourceNamespace

func (x *HTTPMatchRequest) GetSourceNamespace() string

func (*HTTPMatchRequest) GetStatPrefix

func (x *HTTPMatchRequest) GetStatPrefix() string

func (*HTTPMatchRequest) GetUri

func (x *HTTPMatchRequest) GetUri() *StringMatch

func (*HTTPMatchRequest) GetWithoutHeaders

func (x *HTTPMatchRequest) GetWithoutHeaders() map[string]*StringMatch

func (*HTTPMatchRequest) ProtoMessage

func (*HTTPMatchRequest) ProtoMessage()

func (*HTTPMatchRequest) ProtoReflect

func (x *HTTPMatchRequest) ProtoReflect() protoreflect.Message

func (*HTTPMatchRequest) Reset

func (x *HTTPMatchRequest) Reset()

func (*HTTPMatchRequest) String

func (x *HTTPMatchRequest) String() string

type HTTPRedirect

type HTTPRedirect struct {

	// On a redirect, overwrite the Path portion of the URL with this
	// value. Note that the entire path will be replaced, irrespective of the
	// request URI being matched as an exact path or prefix.
	Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
	// On a redirect, overwrite the Authority/Host portion of the URL with
	// this value.
	Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"`
	// Types that are assignable to RedirectPort:
	//	*HTTPRedirect_Port
	//	*HTTPRedirect_DerivePort
	RedirectPort isHTTPRedirect_RedirectPort `protobuf_oneof:"redirect_port"`
	// On a redirect, overwrite the scheme portion of the URL with this value.
	// For example, `http` or `https`.
	// If unset, the original scheme will be used.
	// If `derivePort` is set to `FROM_PROTOCOL_DEFAULT`, this will impact the port used as well
	Scheme string `protobuf:"bytes,6,opt,name=scheme,proto3" json:"scheme,omitempty"`
	// On a redirect, Specifies the HTTP status code to use in the redirect
	// response. The default response code is MOVED_PERMANENTLY (301).
	RedirectCode uint32 `protobuf:"varint,3,opt,name=redirect_code,json=redirectCode,proto3" json:"redirect_code,omitempty"`
	// contains filtered or unexported fields
}

HTTPRedirect can be used to send a 301 redirect response to the caller, where the Authority/Host and the URI in the response can be swapped with the specified values. For example, the following rule redirects requests for /v1/getProductRatings API on the ratings service to /v1/bookRatings provided by the bookratings service.

{{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- match:
  - uri:
      exact: /v1/getProductRatings
  redirect:
    uri: /v1/bookRatings
    authority: newratings.default.svc.cluster.local
...

``` {{</tab>}}

{{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- match:
  - uri:
      exact: /v1/getProductRatings
  redirect:
    uri: /v1/bookRatings
    authority: newratings.default.svc.cluster.local
...

``` {{</tab>}} {{</tabset>}}

func (*HTTPRedirect) DeepCopy

func (in *HTTPRedirect) DeepCopy() *HTTPRedirect

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRedirect. Required by controller-gen.

func (*HTTPRedirect) DeepCopyInterface

func (in *HTTPRedirect) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRedirect. Required by controller-gen.

func (*HTTPRedirect) DeepCopyInto

func (in *HTTPRedirect) DeepCopyInto(out *HTTPRedirect)

DeepCopyInto supports using HTTPRedirect within kubernetes types, where deepcopy-gen is used.

func (*HTTPRedirect) Descriptor deprecated

func (*HTTPRedirect) Descriptor() ([]byte, []int)

Deprecated: Use HTTPRedirect.ProtoReflect.Descriptor instead.

func (*HTTPRedirect) GetAuthority

func (x *HTTPRedirect) GetAuthority() string

func (*HTTPRedirect) GetDerivePort

func (*HTTPRedirect) GetPort

func (x *HTTPRedirect) GetPort() uint32

func (*HTTPRedirect) GetRedirectCode

func (x *HTTPRedirect) GetRedirectCode() uint32

func (*HTTPRedirect) GetRedirectPort

func (m *HTTPRedirect) GetRedirectPort() isHTTPRedirect_RedirectPort

func (*HTTPRedirect) GetScheme

func (x *HTTPRedirect) GetScheme() string

func (*HTTPRedirect) GetUri

func (x *HTTPRedirect) GetUri() string

func (*HTTPRedirect) ProtoMessage

func (*HTTPRedirect) ProtoMessage()

func (*HTTPRedirect) ProtoReflect

func (x *HTTPRedirect) ProtoReflect() protoreflect.Message

func (*HTTPRedirect) Reset

func (x *HTTPRedirect) Reset()

func (*HTTPRedirect) String

func (x *HTTPRedirect) String() string

type HTTPRedirect_DerivePort

type HTTPRedirect_DerivePort struct {
	// On a redirect, dynamically set the port:
	// * FROM_PROTOCOL_DEFAULT: automatically set to 80 for HTTP and 443 for HTTPS.
	// * FROM_REQUEST_PORT: automatically use the port of the request.
	DerivePort HTTPRedirect_RedirectPortSelection `` /* 136-byte string literal not displayed */
}

type HTTPRedirect_Port

type HTTPRedirect_Port struct {
	// On a redirect, overwrite the port portion of the URL with this value.
	Port uint32 `protobuf:"varint,4,opt,name=port,proto3,oneof"`
}

type HTTPRedirect_RedirectPortSelection

type HTTPRedirect_RedirectPortSelection int32
const (
	HTTPRedirect_FROM_PROTOCOL_DEFAULT HTTPRedirect_RedirectPortSelection = 0
	HTTPRedirect_FROM_REQUEST_PORT     HTTPRedirect_RedirectPortSelection = 1
)

func (HTTPRedirect_RedirectPortSelection) Descriptor

func (HTTPRedirect_RedirectPortSelection) Enum

func (HTTPRedirect_RedirectPortSelection) EnumDescriptor deprecated

func (HTTPRedirect_RedirectPortSelection) EnumDescriptor() ([]byte, []int)

Deprecated: Use HTTPRedirect_RedirectPortSelection.Descriptor instead.

func (HTTPRedirect_RedirectPortSelection) Number

func (HTTPRedirect_RedirectPortSelection) String

func (HTTPRedirect_RedirectPortSelection) Type

type HTTPRetry

type HTTPRetry struct {

	// Number of retries to be allowed for a given request. The interval
	// between retries will be determined automatically (25ms+). When request
	// `timeout` of the [HTTP route](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRoute)
	// or `per_try_timeout` is configured, the actual number of retries attempted also depends on
	// the specified request `timeout` and `per_try_timeout` values.
	Attempts int32 `protobuf:"varint,1,opt,name=attempts,proto3" json:"attempts,omitempty"`
	// Timeout per attempt for a given request, including the initial call and any retries. Format: 1h/1m/1s/1ms. MUST BE >=1ms.
	// Default is same value as request
	// `timeout` of the [HTTP route](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRoute),
	// which means no timeout.
	PerTryTimeout *duration.Duration `protobuf:"bytes,2,opt,name=per_try_timeout,json=perTryTimeout,proto3" json:"per_try_timeout,omitempty"`
	// Specifies the conditions under which retry takes place.
	// One or more policies can be specified using a ‘,’ delimited list.
	// If `retry_on` specifies a valid HTTP status, it will be added to retriable_status_codes retry policy.
	// See the [retry policies](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#x-envoy-retry-on)
	// and [gRPC retry policies](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#x-envoy-retry-grpc-on) for more details.
	RetryOn string `protobuf:"bytes,3,opt,name=retry_on,json=retryOn,proto3" json:"retry_on,omitempty"`
	// Flag to specify whether the retries should retry to other localities.
	// See the [retry plugin configuration](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/http/http_connection_management#retry-plugin-configuration) for more details.
	RetryRemoteLocalities *wrappers.BoolValue `` /* 126-byte string literal not displayed */
	// contains filtered or unexported fields
}

Describes the retry policy to use when a HTTP request fails. For example, the following rule sets the maximum number of retries to 3 when calling ratings:v1 service, with a 2s timeout per retry attempt. A retry will be attempted if there is a connect-failure, refused_stream or when the upstream server responds with Service Unavailable(503).

{{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- route:
  - destination:
      host: ratings.prod.svc.cluster.local
      subset: v1
  retries:
    attempts: 3
    perTryTimeout: 2s
    retryOn: connect-failure,refused-stream,503

``` {{</tab>}}

{{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- route:
  - destination:
      host: ratings.prod.svc.cluster.local
      subset: v1
  retries:
    attempts: 3
    perTryTimeout: 2s
    retryOn: gateway-error,connect-failure,refused-stream

``` {{</tab>}} {{</tabset>}}

func (*HTTPRetry) DeepCopy

func (in *HTTPRetry) DeepCopy() *HTTPRetry

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRetry. Required by controller-gen.

func (*HTTPRetry) DeepCopyInterface

func (in *HTTPRetry) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRetry. Required by controller-gen.

func (*HTTPRetry) DeepCopyInto

func (in *HTTPRetry) DeepCopyInto(out *HTTPRetry)

DeepCopyInto supports using HTTPRetry within kubernetes types, where deepcopy-gen is used.

func (*HTTPRetry) Descriptor deprecated

func (*HTTPRetry) Descriptor() ([]byte, []int)

Deprecated: Use HTTPRetry.ProtoReflect.Descriptor instead.

func (*HTTPRetry) GetAttempts

func (x *HTTPRetry) GetAttempts() int32

func (*HTTPRetry) GetPerTryTimeout

func (x *HTTPRetry) GetPerTryTimeout() *duration.Duration

func (*HTTPRetry) GetRetryOn

func (x *HTTPRetry) GetRetryOn() string

func (*HTTPRetry) GetRetryRemoteLocalities

func (x *HTTPRetry) GetRetryRemoteLocalities() *wrappers.BoolValue

func (*HTTPRetry) ProtoMessage

func (*HTTPRetry) ProtoMessage()

func (*HTTPRetry) ProtoReflect

func (x *HTTPRetry) ProtoReflect() protoreflect.Message

func (*HTTPRetry) Reset

func (x *HTTPRetry) Reset()

func (*HTTPRetry) String

func (x *HTTPRetry) String() string

type HTTPRewrite

type HTTPRewrite struct {

	// rewrite the path (or the prefix) portion of the URI with this
	// value. If the original URI was matched based on prefix, the value
	// provided in this field will replace the corresponding matched prefix.
	Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
	// rewrite the Authority/Host header with this value.
	Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"`
	// contains filtered or unexported fields
}

HTTPRewrite can be used to rewrite specific parts of a HTTP request before forwarding the request to the destination. Rewrite primitive can be used only with HTTPRouteDestination. The following example demonstrates how to rewrite the URL prefix for api call (/ratings) to ratings service before making the actual API call.

{{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- match:
  - uri:
      prefix: /ratings
  rewrite:
    uri: /v1/bookRatings
  route:
  - destination:
      host: ratings.prod.svc.cluster.local
      subset: v1

``` {{</tab>}}

{{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:

name: ratings-route

spec:

hosts:
- ratings.prod.svc.cluster.local
http:
- match:
  - uri:
      prefix: /ratings
  rewrite:
    uri: /v1/bookRatings
  route:
  - destination:
      host: ratings.prod.svc.cluster.local
      subset: v1

``` {{</tab>}} {{</tabset>}}

func (*HTTPRewrite) DeepCopy

func (in *HTTPRewrite) DeepCopy() *HTTPRewrite

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRewrite. Required by controller-gen.

func (*HTTPRewrite) DeepCopyInterface

func (in *HTTPRewrite) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRewrite. Required by controller-gen.

func (*HTTPRewrite) DeepCopyInto

func (in *HTTPRewrite) DeepCopyInto(out *HTTPRewrite)

DeepCopyInto supports using HTTPRewrite within kubernetes types, where deepcopy-gen is used.

func (*HTTPRewrite) Descriptor deprecated

func (*HTTPRewrite) Descriptor() ([]byte, []int)

Deprecated: Use HTTPRewrite.ProtoReflect.Descriptor instead.

func (*HTTPRewrite) GetAuthority

func (x *HTTPRewrite) GetAuthority() string

func (*HTTPRewrite) GetUri

func (x *HTTPRewrite) GetUri() string

func (*HTTPRewrite) ProtoMessage

func (*HTTPRewrite) ProtoMessage()

func (*HTTPRewrite) ProtoReflect

func (x *HTTPRewrite) ProtoReflect() protoreflect.Message

func (*HTTPRewrite) Reset

func (x *HTTPRewrite) Reset()

func (*HTTPRewrite) String

func (x *HTTPRewrite) String() string

type HTTPRoute

type HTTPRoute struct {

	// The name assigned to the route for debugging purposes. The
	// route's name will be concatenated with the match's name and will
	// be logged in the access logs for requests matching this
	// route/match.
	Name string `protobuf:"bytes,17,opt,name=name,proto3" json:"name,omitempty"`
	// Match conditions to be satisfied for the rule to be
	// activated. All conditions inside a single match block have AND
	// semantics, while the list of match blocks have OR semantics. The rule
	// is matched if any one of the match blocks succeed.
	Match []*HTTPMatchRequest `protobuf:"bytes,1,rep,name=match,proto3" json:"match,omitempty"`
	// A HTTP rule can either return a direct_response, redirect or forward (default) traffic.
	// The forwarding target can be one of several versions of a service (see
	// glossary in beginning of document). Weights associated with the
	// service version determine the proportion of traffic it receives.
	Route []*HTTPRouteDestination `protobuf:"bytes,2,rep,name=route,proto3" json:"route,omitempty"`
	// A HTTP rule can either return a direct_response, redirect or forward (default) traffic.
	// If traffic passthrough option is specified in the rule,
	// route/redirect will be ignored. The redirect primitive can be used to
	// send a HTTP 301 redirect to a different URI or Authority.
	Redirect *HTTPRedirect `protobuf:"bytes,3,opt,name=redirect,proto3" json:"redirect,omitempty"`
	// A HTTP rule can either return a direct_response, redirect or forward (default) traffic.
	// Direct Response is used to specify a fixed response that should
	// be sent to clients.
	//
	// It can be set only when `Route` and `Redirect` are empty.
	DirectResponse *HTTPDirectResponse `protobuf:"bytes,21,opt,name=direct_response,json=directResponse,proto3" json:"direct_response,omitempty"`
	// Delegate is used to specify the particular VirtualService which
	// can be used to define delegate HTTPRoute.
	//
	// It can be set only when `Route` and `Redirect` are empty, and the route
	// rules of the delegate VirtualService will be merged with that in the
	// current one.
	//
	// **NOTE**:
	//
	// 1. Only one level delegation is supported.
	// 2. The delegate's HTTPMatchRequest must be a strict subset of the root's,
	//    otherwise there is a conflict and the HTTPRoute will not take effect.
	Delegate *Delegate `protobuf:"bytes,20,opt,name=delegate,proto3" json:"delegate,omitempty"`
	// Rewrite HTTP URIs and Authority headers. Rewrite cannot be used with
	// Redirect primitive. Rewrite will be performed before forwarding.
	Rewrite *HTTPRewrite `protobuf:"bytes,4,opt,name=rewrite,proto3" json:"rewrite,omitempty"`
	// Timeout for HTTP requests, default is disabled.
	Timeout *duration.Duration `protobuf:"bytes,6,opt,name=timeout,proto3" json:"timeout,omitempty"`
	// Retry policy for HTTP requests.
	Retries *HTTPRetry `protobuf:"bytes,7,opt,name=retries,proto3" json:"retries,omitempty"`
	// Fault injection policy to apply on HTTP traffic at the client side.
	// Note that timeouts or retries will not be enabled when faults are
	// enabled on the client side.
	Fault *HTTPFaultInjection `protobuf:"bytes,8,opt,name=fault,proto3" json:"fault,omitempty"`
	// Mirror HTTP traffic to a another destination in addition to forwarding
	// the requests to the intended destination. Mirrored traffic is on a
	// best effort basis where the sidecar/gateway will not wait for the
	// mirrored cluster to respond before returning the response from the
	// original destination.  Statistics will be generated for the mirrored
	// destination.
	Mirror *Destination `protobuf:"bytes,9,opt,name=mirror,proto3" json:"mirror,omitempty"`
	// Percentage of the traffic to be mirrored by the `mirror` field.
	// Use of integer `mirror_percent` value is deprecated. Use the
	// double `mirror_percentage` field instead
	// $hide_from_docs
	//
	// Deprecated: Do not use.
	MirrorPercent *wrappers.UInt32Value `protobuf:"bytes,18,opt,name=mirror_percent,json=mirrorPercent,proto3" json:"mirror_percent,omitempty"`
	// Percentage of the traffic to be mirrored by the `mirror` field.
	// If this field is absent, all the traffic (100%) will be mirrored.
	// Max value is 100.
	MirrorPercentage *Percent `protobuf:"bytes,19,opt,name=mirror_percentage,json=mirrorPercentage,proto3" json:"mirror_percentage,omitempty"`
	// Cross-Origin Resource Sharing policy (CORS). Refer to
	// [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)
	// for further details about cross origin resource sharing.
	CorsPolicy *CorsPolicy `protobuf:"bytes,10,opt,name=cors_policy,json=corsPolicy,proto3" json:"cors_policy,omitempty"`
	// Header manipulation rules
	Headers *Headers `protobuf:"bytes,16,opt,name=headers,proto3" json:"headers,omitempty"`
	// contains filtered or unexported fields
}

Describes match conditions and actions for routing HTTP/1.1, HTTP2, and gRPC traffic. See VirtualService for usage examples.

func (*HTTPRoute) DeepCopy

func (in *HTTPRoute) DeepCopy() *HTTPRoute

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRoute. Required by controller-gen.

func (*HTTPRoute) DeepCopyInterface

func (in *HTTPRoute) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRoute. Required by controller-gen.

func (*HTTPRoute) DeepCopyInto

func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute)

DeepCopyInto supports using HTTPRoute within kubernetes types, where deepcopy-gen is used.

func (*HTTPRoute) Descriptor deprecated

func (*HTTPRoute) Descriptor() ([]byte, []int)

Deprecated: Use HTTPRoute.ProtoReflect.Descriptor instead.

func (*HTTPRoute) GetCorsPolicy

func (x *HTTPRoute) GetCorsPolicy() *CorsPolicy

func (*HTTPRoute) GetDelegate

func (x *HTTPRoute) GetDelegate() *Delegate

func (*HTTPRoute) GetDirectResponse

func (x *HTTPRoute) GetDirectResponse() *HTTPDirectResponse

func (*HTTPRoute) GetFault

func (x *HTTPRoute) GetFault() *HTTPFaultInjection

func (*HTTPRoute) GetHeaders

func (x *HTTPRoute) GetHeaders() *Headers

func (*HTTPRoute) GetMatch

func (x *HTTPRoute) GetMatch() []*HTTPMatchRequest

func (*HTTPRoute) GetMirror

func (x *HTTPRoute) GetMirror() *Destination

func (*HTTPRoute) GetMirrorPercent deprecated

func (x *HTTPRoute) GetMirrorPercent() *wrappers.UInt32Value

Deprecated: Do not use.

func (*HTTPRoute) GetMirrorPercentage

func (x *HTTPRoute) GetMirrorPercentage() *Percent

func (*HTTPRoute) GetName

func (x *HTTPRoute) GetName() string

func (*HTTPRoute) GetRedirect

func (x *HTTPRoute) GetRedirect() *HTTPRedirect

func (*HTTPRoute) GetRetries

func (x *HTTPRoute) GetRetries() *HTTPRetry

func (*HTTPRoute) GetRewrite

func (x *HTTPRoute) GetRewrite() *HTTPRewrite

func (*HTTPRoute) GetRoute

func (x *HTTPRoute) GetRoute() []*HTTPRouteDestination

func (*HTTPRoute) GetTimeout

func (x *HTTPRoute) GetTimeout() *duration.Duration

func (*HTTPRoute) ProtoMessage

func (*HTTPRoute) ProtoMessage()

func (*HTTPRoute) ProtoReflect

func (x *HTTPRoute) ProtoReflect() protoreflect.Message

func (*HTTPRoute) Reset

func (x *HTTPRoute) Reset()

func (*HTTPRoute) String

func (x *HTTPRoute) String() string

type HTTPRouteDestination

type HTTPRouteDestination struct {

	// Destination uniquely identifies the instances of a service
	// to which the request/connection should be forwarded to.
	Destination *Destination `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`
	// Weight specifies the relative proportion of traffic to be forwarded to the destination. A destination will receive `weight/(sum of all weights)` requests.
	// If there is only one destination in a rule, it will receive all traffic.
	// Otherwise, if weight is `0`, the destination will not receive any traffic.
	Weight int32 `protobuf:"varint,2,opt,name=weight,proto3" json:"weight,omitempty"`
	// Header manipulation rules
	Headers *Headers `protobuf:"bytes,7,opt,name=headers,proto3" json:"headers,omitempty"`
	// contains filtered or unexported fields
}

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>}}

func (*HTTPRouteDestination) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRouteDestination. Required by controller-gen.

func (*HTTPRouteDestination) DeepCopyInterface

func (in *HTTPRouteDestination) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRouteDestination. Required by controller-gen.

func (*HTTPRouteDestination) DeepCopyInto

func (in *HTTPRouteDestination) DeepCopyInto(out *HTTPRouteDestination)

DeepCopyInto supports using HTTPRouteDestination within kubernetes types, where deepcopy-gen is used.

func (*HTTPRouteDestination) Descriptor deprecated

func (*HTTPRouteDestination) Descriptor() ([]byte, []int)

Deprecated: Use HTTPRouteDestination.ProtoReflect.Descriptor instead.

func (*HTTPRouteDestination) GetDestination

func (x *HTTPRouteDestination) GetDestination() *Destination

func (*HTTPRouteDestination) GetHeaders

func (x *HTTPRouteDestination) GetHeaders() *Headers

func (*HTTPRouteDestination) GetWeight

func (x *HTTPRouteDestination) GetWeight() int32

func (*HTTPRouteDestination) ProtoMessage

func (*HTTPRouteDestination) ProtoMessage()

func (*HTTPRouteDestination) ProtoReflect

func (x *HTTPRouteDestination) ProtoReflect() protoreflect.Message

func (*HTTPRouteDestination) Reset

func (x *HTTPRouteDestination) Reset()

func (*HTTPRouteDestination) String

func (x *HTTPRouteDestination) String() string

type Headers

type Headers struct {

	// Header manipulation rules to apply before forwarding a request
	// to the destination service
	Request *Headers_HeaderOperations `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
	// Header manipulation rules to apply before returning a response
	// to the caller
	Response *Headers_HeaderOperations `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"`
	// contains filtered or unexported fields
}

Message headers can be manipulated when Envoy forwards requests to, or responses from, a destination service. Header manipulation rules can be specified for a specific route destination or for all destinations. The following VirtualService adds a `test` header with the value `true` to requests that are routed to any `reviews` service destination. It also removes the `foo` response header, but only from responses coming from the `v1` subset (version) of the `reviews` service.

{{<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:
- headers:
    request:
      set:
        test: "true"
  route:
  - destination:
      host: reviews.prod.svc.cluster.local
      subset: v2
    weight: 25
  - destination:
      host: reviews.prod.svc.cluster.local
      subset: v1
    headers:
      response:
        remove:
        - foo
    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:
- headers:
    request:
      set:
        test: "true"
  route:
  - destination:
      host: reviews.prod.svc.cluster.local
      subset: v2
    weight: 25
  - destination:
      host: reviews.prod.svc.cluster.local
      subset: v1
    headers:
      response:
        remove:
        - foo
    weight: 75

``` {{</tab>}} {{</tabset>}}

func (*Headers) DeepCopy

func (in *Headers) DeepCopy() *Headers

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Headers. Required by controller-gen.

func (*Headers) DeepCopyInterface

func (in *Headers) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new Headers. Required by controller-gen.

func (*Headers) DeepCopyInto

func (in *Headers) DeepCopyInto(out *Headers)

DeepCopyInto supports using Headers within kubernetes types, where deepcopy-gen is used.

func (*Headers) Descriptor deprecated

func (*Headers) Descriptor() ([]byte, []int)

Deprecated: Use Headers.ProtoReflect.Descriptor instead.

func (*Headers) GetRequest

func (x *Headers) GetRequest() *Headers_HeaderOperations

func (*Headers) GetResponse

func (x *Headers) GetResponse() *Headers_HeaderOperations

func (*Headers) ProtoMessage

func (*Headers) ProtoMessage()

func (*Headers) ProtoReflect

func (x *Headers) ProtoReflect() protoreflect.Message

func (*Headers) Reset

func (x *Headers) Reset()

func (*Headers) String

func (x *Headers) String() string

type Headers_HeaderOperations

type Headers_HeaderOperations struct {

	// Overwrite the headers specified by key with the given values
	Set map[string]string `` /* 147-byte string literal not displayed */
	// Append the given values to the headers specified by keys
	// (will create a comma-separated list of values)
	Add map[string]string `` /* 147-byte string literal not displayed */
	// Remove the specified headers
	Remove []string `protobuf:"bytes,3,rep,name=remove,proto3" json:"remove,omitempty"`
	// contains filtered or unexported fields
}

HeaderOperations Describes the header manipulations to apply

func (*Headers_HeaderOperations) Descriptor deprecated

func (*Headers_HeaderOperations) Descriptor() ([]byte, []int)

Deprecated: Use Headers_HeaderOperations.ProtoReflect.Descriptor instead.

func (*Headers_HeaderOperations) GetAdd

func (x *Headers_HeaderOperations) GetAdd() map[string]string

func (*Headers_HeaderOperations) GetRemove

func (x *Headers_HeaderOperations) GetRemove() []string

func (*Headers_HeaderOperations) GetSet

func (x *Headers_HeaderOperations) GetSet() map[string]string

func (*Headers_HeaderOperations) ProtoMessage

func (*Headers_HeaderOperations) ProtoMessage()

func (*Headers_HeaderOperations) ProtoReflect

func (x *Headers_HeaderOperations) ProtoReflect() protoreflect.Message

func (*Headers_HeaderOperations) Reset

func (x *Headers_HeaderOperations) Reset()

func (*Headers_HeaderOperations) String

func (x *Headers_HeaderOperations) String() string

type L4MatchAttributes

type L4MatchAttributes struct {

	// IPv4 or IPv6 ip addresses of destination with optional subnet.  E.g.,
	// a.b.c.d/xx form or just a.b.c.d.
	DestinationSubnets []string `protobuf:"bytes,1,rep,name=destination_subnets,json=destinationSubnets,proto3" json:"destination_subnets,omitempty"`
	// Specifies the port on the host that is being addressed. Many services
	// only expose a single port or label ports with the protocols they support,
	// in these cases it is not required to explicitly select the port.
	Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"`
	// IPv4 or IPv6 ip address of source with optional subnet. E.g., a.b.c.d/xx
	// form or just a.b.c.d
	// $hide_from_docs
	SourceSubnet string `protobuf:"bytes,3,opt,name=source_subnet,json=sourceSubnet,proto3" json:"source_subnet,omitempty"`
	// One or more labels that constrain the applicability of a rule to
	// workloads with the given labels. If the VirtualService has a list of
	// gateways specified in the top-level `gateways` field, it should include the reserved gateway
	// `mesh` in order for this field to be applicable.
	SourceLabels map[string]string `` /* 185-byte string literal not displayed */
	// Names of gateways where the rule should be applied. Gateway names
	// in the top-level `gateways` field of the VirtualService (if any) are overridden. The gateway
	// match is independent of sourceLabels.
	Gateways []string `protobuf:"bytes,5,rep,name=gateways,proto3" json:"gateways,omitempty"`
	// Source namespace constraining the applicability of a rule to workloads in that namespace.
	// If the VirtualService has a list of gateways specified in the top-level `gateways` field,
	// it must include the reserved gateway `mesh` for this field to be applicable.
	SourceNamespace string `protobuf:"bytes,6,opt,name=source_namespace,json=sourceNamespace,proto3" json:"source_namespace,omitempty"`
	// contains filtered or unexported fields
}

L4 connection match attributes. Note that L4 connection matching support is incomplete.

func (*L4MatchAttributes) DeepCopy

func (in *L4MatchAttributes) DeepCopy() *L4MatchAttributes

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new L4MatchAttributes. Required by controller-gen.

func (*L4MatchAttributes) DeepCopyInterface

func (in *L4MatchAttributes) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new L4MatchAttributes. Required by controller-gen.

func (*L4MatchAttributes) DeepCopyInto

func (in *L4MatchAttributes) DeepCopyInto(out *L4MatchAttributes)

DeepCopyInto supports using L4MatchAttributes within kubernetes types, where deepcopy-gen is used.

func (*L4MatchAttributes) Descriptor deprecated

func (*L4MatchAttributes) Descriptor() ([]byte, []int)

Deprecated: Use L4MatchAttributes.ProtoReflect.Descriptor instead.

func (*L4MatchAttributes) GetDestinationSubnets

func (x *L4MatchAttributes) GetDestinationSubnets() []string

func (*L4MatchAttributes) GetGateways

func (x *L4MatchAttributes) GetGateways() []string

func (*L4MatchAttributes) GetPort

func (x *L4MatchAttributes) GetPort() uint32

func (*L4MatchAttributes) GetSourceLabels

func (x *L4MatchAttributes) GetSourceLabels() map[string]string

func (*L4MatchAttributes) GetSourceNamespace

func (x *L4MatchAttributes) GetSourceNamespace() string

func (*L4MatchAttributes) GetSourceSubnet

func (x *L4MatchAttributes) GetSourceSubnet() string

func (*L4MatchAttributes) ProtoMessage

func (*L4MatchAttributes) ProtoMessage()

func (*L4MatchAttributes) ProtoReflect

func (x *L4MatchAttributes) ProtoReflect() protoreflect.Message

func (*L4MatchAttributes) Reset

func (x *L4MatchAttributes) Reset()

func (*L4MatchAttributes) String

func (x *L4MatchAttributes) String() string

type Percent

type Percent struct {
	Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Percent specifies a percentage in the range of [0.0, 100.0].

func (*Percent) DeepCopy

func (in *Percent) DeepCopy() *Percent

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Percent. Required by controller-gen.

func (*Percent) DeepCopyInterface

func (in *Percent) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new Percent. Required by controller-gen.

func (*Percent) DeepCopyInto

func (in *Percent) DeepCopyInto(out *Percent)

DeepCopyInto supports using Percent within kubernetes types, where deepcopy-gen is used.

func (*Percent) Descriptor deprecated

func (*Percent) Descriptor() ([]byte, []int)

Deprecated: Use Percent.ProtoReflect.Descriptor instead.

func (*Percent) GetValue

func (x *Percent) GetValue() float64

func (*Percent) ProtoMessage

func (*Percent) ProtoMessage()

func (*Percent) ProtoReflect

func (x *Percent) ProtoReflect() protoreflect.Message

func (*Percent) Reset

func (x *Percent) Reset()

func (*Percent) String

func (x *Percent) String() string

type PortSelector

type PortSelector struct {

	// Valid port number
	Number uint32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	// contains filtered or unexported fields
}

PortSelector specifies the number of a port to be used for matching or selection for final routing.

func (*PortSelector) DeepCopy

func (in *PortSelector) DeepCopy() *PortSelector

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortSelector. Required by controller-gen.

func (*PortSelector) DeepCopyInterface

func (in *PortSelector) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new PortSelector. Required by controller-gen.

func (*PortSelector) DeepCopyInto

func (in *PortSelector) DeepCopyInto(out *PortSelector)

DeepCopyInto supports using PortSelector within kubernetes types, where deepcopy-gen is used.

func (*PortSelector) Descriptor deprecated

func (*PortSelector) Descriptor() ([]byte, []int)

Deprecated: Use PortSelector.ProtoReflect.Descriptor instead.

func (*PortSelector) GetNumber

func (x *PortSelector) GetNumber() uint32

func (*PortSelector) ProtoMessage

func (*PortSelector) ProtoMessage()

func (*PortSelector) ProtoReflect

func (x *PortSelector) ProtoReflect() protoreflect.Message

func (*PortSelector) Reset

func (x *PortSelector) Reset()

func (*PortSelector) String

func (x *PortSelector) String() string

type RouteDestination

type RouteDestination struct {

	// Destination uniquely identifies the instances of a service
	// to which the request/connection should be forwarded to.
	Destination *Destination `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"`
	// Weight specifies the relative proportion of traffic to be forwarded to the destination. A destination will receive `weight/(sum of all weights)` requests.
	// If there is only one destination in a rule, it will receive all traffic.
	// Otherwise, if weight is `0`, the destination will not receive any traffic.
	Weight int32 `protobuf:"varint,2,opt,name=weight,proto3" json:"weight,omitempty"`
	// contains filtered or unexported fields
}

L4 routing rule weighted destination.

func (*RouteDestination) DeepCopy

func (in *RouteDestination) DeepCopy() *RouteDestination

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteDestination. Required by controller-gen.

func (*RouteDestination) DeepCopyInterface

func (in *RouteDestination) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RouteDestination. Required by controller-gen.

func (*RouteDestination) DeepCopyInto

func (in *RouteDestination) DeepCopyInto(out *RouteDestination)

DeepCopyInto supports using RouteDestination within kubernetes types, where deepcopy-gen is used.

func (*RouteDestination) Descriptor deprecated

func (*RouteDestination) Descriptor() ([]byte, []int)

Deprecated: Use RouteDestination.ProtoReflect.Descriptor instead.

func (*RouteDestination) GetDestination

func (x *RouteDestination) GetDestination() *Destination

func (*RouteDestination) GetWeight

func (x *RouteDestination) GetWeight() int32

func (*RouteDestination) ProtoMessage

func (*RouteDestination) ProtoMessage()

func (*RouteDestination) ProtoReflect

func (x *RouteDestination) ProtoReflect() protoreflect.Message

func (*RouteDestination) Reset

func (x *RouteDestination) Reset()

func (*RouteDestination) String

func (x *RouteDestination) String() string

type StringMatch

type StringMatch struct {

	// exact string match
	Exact string `protobuf:"bytes,1,opt,name=exact,proto3" json:"exact,omitempty"`
	// prefix-based match
	Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
	// RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).
	Regex string `protobuf:"bytes,3,opt,name=regex,proto3" json:"regex,omitempty"` //  }
	// contains filtered or unexported fields
}

Describes how to match a given string in HTTP headers. Match is case-sensitive.

func (*StringMatch) DeepCopy

func (in *StringMatch) DeepCopy() *StringMatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StringMatch. Required by controller-gen.

func (*StringMatch) DeepCopyInterface

func (in *StringMatch) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new StringMatch. Required by controller-gen.

func (*StringMatch) DeepCopyInto

func (in *StringMatch) DeepCopyInto(out *StringMatch)

DeepCopyInto supports using StringMatch within kubernetes types, where deepcopy-gen is used.

func (*StringMatch) Descriptor deprecated

func (*StringMatch) Descriptor() ([]byte, []int)

Deprecated: Use StringMatch.ProtoReflect.Descriptor instead.

func (*StringMatch) GetExact

func (x *StringMatch) GetExact() string

func (*StringMatch) GetPrefix

func (x *StringMatch) GetPrefix() string

func (*StringMatch) GetRegex

func (x *StringMatch) GetRegex() string

func (*StringMatch) ProtoMessage

func (*StringMatch) ProtoMessage()

func (*StringMatch) ProtoReflect

func (x *StringMatch) ProtoReflect() protoreflect.Message

func (*StringMatch) Reset

func (x *StringMatch) Reset()

func (*StringMatch) String

func (x *StringMatch) String() string

type TCPRoute

type TCPRoute struct {

	// Match conditions to be satisfied for the rule to be
	// activated. All conditions inside a single match block have AND
	// semantics, while the list of match blocks have OR semantics. The rule
	// is matched if any one of the match blocks succeed.
	Match []*L4MatchAttributes `protobuf:"bytes,1,rep,name=match,proto3" json:"match,omitempty"`
	// The destination to which the connection should be forwarded to.
	Route []*RouteDestination `protobuf:"bytes,2,rep,name=route,proto3" json:"route,omitempty"`
	// contains filtered or unexported fields
}

Describes match conditions and actions for routing TCP traffic. The following routing rule forwards traffic arriving at port 27017 for mongo.prod.svc.cluster.local to another Mongo server on port 5555.

{{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: bookinfo-mongo

spec:

hosts:
- mongo.prod.svc.cluster.local
tcp:
- match:
  - port: 27017
  route:
  - destination:
      host: mongo.backup.svc.cluster.local
      port:
        number: 5555

``` {{</tab>}}

{{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:

name: bookinfo-mongo

spec:

hosts:
- mongo.prod.svc.cluster.local
tcp:
- match:
  - port: 27017
  route:
  - destination:
      host: mongo.backup.svc.cluster.local
      port:
        number: 5555

``` {{</tab>}} {{</tabset>}}

func (*TCPRoute) DeepCopy

func (in *TCPRoute) DeepCopy() *TCPRoute

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TCPRoute. Required by controller-gen.

func (*TCPRoute) DeepCopyInterface

func (in *TCPRoute) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new TCPRoute. Required by controller-gen.

func (*TCPRoute) DeepCopyInto

func (in *TCPRoute) DeepCopyInto(out *TCPRoute)

DeepCopyInto supports using TCPRoute within kubernetes types, where deepcopy-gen is used.

func (*TCPRoute) Descriptor deprecated

func (*TCPRoute) Descriptor() ([]byte, []int)

Deprecated: Use TCPRoute.ProtoReflect.Descriptor instead.

func (*TCPRoute) GetMatch

func (x *TCPRoute) GetMatch() []*L4MatchAttributes

func (*TCPRoute) GetRoute

func (x *TCPRoute) GetRoute() []*RouteDestination

func (*TCPRoute) ProtoMessage

func (*TCPRoute) ProtoMessage()

func (*TCPRoute) ProtoReflect

func (x *TCPRoute) ProtoReflect() protoreflect.Message

func (*TCPRoute) Reset

func (x *TCPRoute) Reset()

func (*TCPRoute) String

func (x *TCPRoute) String() string

type TLSMatchAttributes

type TLSMatchAttributes struct {

	// SNI (server name indicator) to match on. Wildcard prefixes
	// can be used in the SNI value, e.g., *.com will match foo.example.com
	// as well as example.com. An SNI value must be a subset (i.e., fall
	// within the domain) of the corresponding virtual serivce's hosts.
	SniHosts []string `protobuf:"bytes,1,rep,name=sni_hosts,json=sniHosts,proto3" json:"sni_hosts,omitempty"`
	// IPv4 or IPv6 ip addresses of destination with optional subnet.  E.g.,
	// a.b.c.d/xx form or just a.b.c.d.
	DestinationSubnets []string `protobuf:"bytes,2,rep,name=destination_subnets,json=destinationSubnets,proto3" json:"destination_subnets,omitempty"`
	// Specifies the port on the host that is being addressed. Many services
	// only expose a single port or label ports with the protocols they
	// support, in these cases it is not required to explicitly select the
	// port.
	Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
	// One or more labels that constrain the applicability of a rule to
	// workloads with the given labels. If the VirtualService has a list of
	// gateways specified in the top-level `gateways` field, it should include the reserved gateway
	// `mesh` in order for this field to be applicable.
	SourceLabels map[string]string `` /* 185-byte string literal not displayed */
	// Names of gateways where the rule should be applied. Gateway names
	// in the top-level `gateways` field of the VirtualService (if any) are overridden. The gateway
	// match is independent of sourceLabels.
	Gateways []string `protobuf:"bytes,6,rep,name=gateways,proto3" json:"gateways,omitempty"`
	// Source namespace constraining the applicability of a rule to workloads in that namespace.
	// If the VirtualService has a list of gateways specified in the top-level `gateways` field,
	// it must include the reserved gateway `mesh` for this field to be applicable.
	SourceNamespace string `protobuf:"bytes,7,opt,name=source_namespace,json=sourceNamespace,proto3" json:"source_namespace,omitempty"`
	// contains filtered or unexported fields
}

TLS connection match attributes.

func (*TLSMatchAttributes) DeepCopy

func (in *TLSMatchAttributes) DeepCopy() *TLSMatchAttributes

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSMatchAttributes. Required by controller-gen.

func (*TLSMatchAttributes) DeepCopyInterface

func (in *TLSMatchAttributes) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new TLSMatchAttributes. Required by controller-gen.

func (*TLSMatchAttributes) DeepCopyInto

func (in *TLSMatchAttributes) DeepCopyInto(out *TLSMatchAttributes)

DeepCopyInto supports using TLSMatchAttributes within kubernetes types, where deepcopy-gen is used.

func (*TLSMatchAttributes) Descriptor deprecated

func (*TLSMatchAttributes) Descriptor() ([]byte, []int)

Deprecated: Use TLSMatchAttributes.ProtoReflect.Descriptor instead.

func (*TLSMatchAttributes) GetDestinationSubnets

func (x *TLSMatchAttributes) GetDestinationSubnets() []string

func (*TLSMatchAttributes) GetGateways

func (x *TLSMatchAttributes) GetGateways() []string

func (*TLSMatchAttributes) GetPort

func (x *TLSMatchAttributes) GetPort() uint32

func (*TLSMatchAttributes) GetSniHosts

func (x *TLSMatchAttributes) GetSniHosts() []string

func (*TLSMatchAttributes) GetSourceLabels

func (x *TLSMatchAttributes) GetSourceLabels() map[string]string

func (*TLSMatchAttributes) GetSourceNamespace

func (x *TLSMatchAttributes) GetSourceNamespace() string

func (*TLSMatchAttributes) ProtoMessage

func (*TLSMatchAttributes) ProtoMessage()

func (*TLSMatchAttributes) ProtoReflect

func (x *TLSMatchAttributes) ProtoReflect() protoreflect.Message

func (*TLSMatchAttributes) Reset

func (x *TLSMatchAttributes) Reset()

func (*TLSMatchAttributes) String

func (x *TLSMatchAttributes) String() string

type TLSRoute

type TLSRoute struct {

	// Match conditions to be satisfied for the rule to be
	// activated. All conditions inside a single match block have AND
	// semantics, while the list of match blocks have OR semantics. The rule
	// is matched if any one of the match blocks succeed.
	Match []*TLSMatchAttributes `protobuf:"bytes,1,rep,name=match,proto3" json:"match,omitempty"`
	// The destination to which the connection should be forwarded to.
	Route []*RouteDestination `protobuf:"bytes,2,rep,name=route,proto3" json:"route,omitempty"`
	// contains filtered or unexported fields
}

Describes match conditions and actions for routing unterminated TLS traffic (TLS/HTTPS) The following routing rule forwards unterminated TLS traffic arriving at port 443 of gateway called "mygateway" to internal services in the mesh based on the SNI value.

{{<tabset category-name="example">}} {{<tab name="v1alpha3" category-value="v1alpha3">}} ```yaml apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata:

name: bookinfo-sni

spec:

hosts:
- "*.bookinfo.com"
gateways:
- mygateway
tls:
- match:
  - port: 443
    sniHosts:
    - login.bookinfo.com
  route:
  - destination:
      host: login.prod.svc.cluster.local
- match:
  - port: 443
    sniHosts:
    - reviews.bookinfo.com
  route:
  - destination:
      host: reviews.prod.svc.cluster.local

``` {{</tab>}}

{{<tab name="v1beta1" category-value="v1beta1">}} ```yaml apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:

name: bookinfo-sni

spec:

hosts:
- "*.bookinfo.com"
gateways:
- mygateway
tls:
- match:
  - port: 443
    sniHosts:
    - login.bookinfo.com
  route:
  - destination:
      host: login.prod.svc.cluster.local
- match:
  - port: 443
    sniHosts:
    - reviews.bookinfo.com
  route:
  - destination:
      host: reviews.prod.svc.cluster.local

``` {{</tab>}} {{</tabset>}}

func (*TLSRoute) DeepCopy

func (in *TLSRoute) DeepCopy() *TLSRoute

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSRoute. Required by controller-gen.

func (*TLSRoute) DeepCopyInterface

func (in *TLSRoute) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new TLSRoute. Required by controller-gen.

func (*TLSRoute) DeepCopyInto

func (in *TLSRoute) DeepCopyInto(out *TLSRoute)

DeepCopyInto supports using TLSRoute within kubernetes types, where deepcopy-gen is used.

func (*TLSRoute) Descriptor deprecated

func (*TLSRoute) Descriptor() ([]byte, []int)

Deprecated: Use TLSRoute.ProtoReflect.Descriptor instead.

func (*TLSRoute) GetMatch

func (x *TLSRoute) GetMatch() []*TLSMatchAttributes

func (*TLSRoute) GetRoute

func (x *TLSRoute) GetRoute() []*RouteDestination

func (*TLSRoute) ProtoMessage

func (*TLSRoute) ProtoMessage()

func (*TLSRoute) ProtoReflect

func (x *TLSRoute) ProtoReflect() protoreflect.Message

func (*TLSRoute) Reset

func (x *TLSRoute) Reset()

func (*TLSRoute) String

func (x *TLSRoute) String() string

type TrafficRouter

type TrafficRouter struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec TrafficRouterSpec `json:"spec,omitempty"`

	Status TrafficRouterStatus `json:"status,omitempty"`
}

+kubebuilder:object:root=true

func (*TrafficRouter) DeepCopy

func (in *TrafficRouter) DeepCopy() *TrafficRouter

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrafficRouterRule.

func (*TrafficRouter) DeepCopyInto

func (in *TrafficRouter) DeepCopyInto(out *TrafficRouter)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TrafficRouter) DeepCopyObject

func (in *TrafficRouter) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TrafficRouterList

type TrafficRouterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []TrafficRouter `json:"items"`
}

HttpRequestMatchRuleList contains a list of HttpRequestMatchRule. +kubebuilder:object:root=true

func (*TrafficRouterList) DeepCopy

func (in *TrafficRouterList) DeepCopy() *TrafficRouterList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrafficRouterRuleList.

func (*TrafficRouterList) DeepCopyInto

func (in *TrafficRouterList) DeepCopyInto(out *TrafficRouterList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*TrafficRouterList) DeepCopyObject

func (in *TrafficRouterList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TrafficRouterSpec

type TrafficRouterSpec struct {

	// The destination hosts to which traffic is being sent. Could
	// be a DNS name with wildcard prefix or an IP address.  Depending on the
	// platform, short-names can also be used instead of a FQDN (i.e. has no
	// dots in the name). In such a scenario, the FQDN of the host would be
	// derived based on the underlying platform.
	//
	// A single VirtualService can be used to describe all the traffic
	// properties of the corresponding hosts, including those for multiple
	// HTTP and TCP ports. Alternatively, the traffic properties of a host
	// can be defined using more than one VirtualService, with certain
	// caveats. Refer to the
	// [Operations Guide](https://istio.io/docs/ops/best-practices/traffic-management/#split-virtual-services)
	// for details.
	//
	// *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 hosts field applies to both HTTP and TCP services. Service inside
	// the mesh, i.e., those found in the service registry, must always be
	// referred to using their alphanumeric names. IP addresses are allowed
	// only for services defined via the Gateway.
	//
	// *Note*: It must be empty for a delegate VirtualService.
	Hosts []string `protobuf:"bytes,1,rep,name=hosts,proto3" json:"hosts,omitempty"`
	// The names of gateways and sidecars that should apply these routes.
	// Gateways in other namespaces may be referred to by
	// `<gateway namespace>/<gateway name>`; specifying a gateway with no
	// namespace qualifier is the same as specifying the VirtualService's
	// namespace. A single VirtualService is used for sidecars inside the mesh as
	// well as for one or more gateways. The selection condition imposed by this
	// field can be overridden using the source field in the match conditions
	// of protocol-specific routes. The reserved word `mesh` is used to imply
	// all the sidecars in the mesh. When this field is omitted, the default
	// gateway (`mesh`) will be used, which would apply the rule to all
	// sidecars in the mesh. If a list of gateway names is provided, the
	// rules will apply only to the gateways. To apply the rules to both
	// gateways and sidecars, specify `mesh` as one of the gateway names.
	Gateways []string `protobuf:"bytes,2,rep,name=gateways,proto3" json:"gateways,omitempty"`
	// An ordered list of route rules for HTTP traffic. HTTP routes will be
	// applied to platform service ports named 'http-*'/'http2-*'/'grpc-*', gateway
	// ports with protocol HTTP/HTTP2/GRPC/ TLS-terminated-HTTPS and service
	// entry ports using HTTP/HTTP2/GRPC protocols.  The first rule matching
	// an incoming request is used.
	Http []*HTTPRoute `protobuf:"bytes,3,rep,name=http,proto3" json:"http,omitempty"`
	// An ordered list of route rule for non-terminated TLS & HTTPS
	// traffic. Routing is typically performed using the SNI value presented
	// by the ClientHello message. TLS routes will be applied to platform
	// service ports named 'https-*', 'tls-*', unterminated gateway ports using
	// HTTPS/TLS protocols (i.e. with "passthrough" TLS mode) and service
	// entry ports using HTTPS/TLS protocols.  The first rule matching an
	// incoming request is used.  NOTE: Traffic 'https-*' or 'tls-*' ports
	// without associated virtual service will be treated as opaque TCP
	// traffic.
	Tls []*TLSRoute `protobuf:"bytes,5,rep,name=tls,proto3" json:"tls,omitempty"`
	// An ordered list of route rules for opaque TCP traffic. TCP routes will
	// be applied to any port that is not a HTTP or TLS port. The first rule
	// matching an incoming request is used.
	Tcp []*TCPRoute `protobuf:"bytes,4,rep,name=tcp,proto3" json:"tcp,omitempty"`
	// A list of namespaces to which this virtual service is exported. Exporting a
	// virtual service allows it to be used by sidecars and gateways defined in
	// other namespaces. This feature provides a mechanism for service owners
	// and mesh administrators to control the visibility of virtual services
	// across namespace boundaries.
	//
	// If no namespaces are specified then the virtual service is exported to all
	// namespaces by default.
	//
	// The value "." is reserved and defines an export to the same namespace that
	// the virtual service is declared in. Similarly the value "*" is reserved and
	// defines an export to all namespaces.
	ExportTo []string `protobuf:"bytes,6,rep,name=export_to,json=exportTo,proto3" json:"export_to,omitempty"`
	// contains filtered or unexported fields
}

Configuration affecting traffic routing.

<!-- crd generation tags +cue-gen:TrafficRouterSpec:groupName:traffic.opensergo.io +cue-gen:TrafficRouterSpec:version:v1alpha1 +cue-gen:TrafficRouterSpec:annotations:helm.sh/resource-policy=keep +cue-gen:TrafficRouterSpec:labels:app=istio-pilot,chart=istio,heritage=Tiller,release=istio +cue-gen:TrafficRouterSpec:subresource:status +cue-gen:TrafficRouterSpec:scope:Namespaced +cue-gen:TrafficRouterSpec:resource:categories=istio-io,networking-istio-io,shortNames=vs +cue-gen:TrafficRouterSpec:printerColumn:name=Gateways,type=string,JSONPath=.spec.gateways,description="The names of gateways and sidecars that should apply these routes" +cue-gen:TrafficRouterSpec:printerColumn:name=Hosts,type=string,JSONPath=.spec.hosts,description="The destination hosts to which traffic is being sent" +cue-gen:TrafficRouterSpec:printerColumn:name=Age,type=date,JSONPath=.metadata.creationTimestamp,description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" +cue-gen:TrafficRouterSpec:preserveUnknownFields:false -->

<!-- go code generation tags +kubetype-gen +kubetype-gen:groupVersion=traffic.opensergo.io/v1alpha1 +genclient +k8s:deepcopy-gen=true --> <!-- istio code generation tags +istio.io/sync-from:networking/v1alpha3/virtual_service.proto -->

func (*TrafficRouterSpec) DeepCopy

func (in *TrafficRouterSpec) DeepCopy() *TrafficRouterSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrafficRouterSpec. Required by controller-gen.

func (*TrafficRouterSpec) DeepCopyInterface

func (in *TrafficRouterSpec) DeepCopyInterface() interface{}

DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new TrafficRouterSpec. Required by controller-gen.

func (*TrafficRouterSpec) DeepCopyInto

func (in *TrafficRouterSpec) DeepCopyInto(out *TrafficRouterSpec)

DeepCopyInto supports using TrafficRouterSpec within kubernetes types, where deepcopy-gen is used.

func (*TrafficRouterSpec) Descriptor deprecated

func (*TrafficRouterSpec) Descriptor() ([]byte, []int)

Deprecated: Use TrafficRouterSpec.ProtoReflect.Descriptor instead.

func (*TrafficRouterSpec) GetExportTo

func (x *TrafficRouterSpec) GetExportTo() []string

func (*TrafficRouterSpec) GetGateways

func (x *TrafficRouterSpec) GetGateways() []string

func (*TrafficRouterSpec) GetHosts

func (x *TrafficRouterSpec) GetHosts() []string

func (*TrafficRouterSpec) GetHttp

func (x *TrafficRouterSpec) GetHttp() []*HTTPRoute

func (*TrafficRouterSpec) GetTcp

func (x *TrafficRouterSpec) GetTcp() []*TCPRoute

func (*TrafficRouterSpec) GetTls

func (x *TrafficRouterSpec) GetTls() []*TLSRoute

func (*TrafficRouterSpec) ProtoMessage

func (*TrafficRouterSpec) ProtoMessage()

func (*TrafficRouterSpec) ProtoReflect

func (x *TrafficRouterSpec) ProtoReflect() protoreflect.Message

func (*TrafficRouterSpec) Reset

func (x *TrafficRouterSpec) Reset()

func (*TrafficRouterSpec) String

func (x *TrafficRouterSpec) String() string

type TrafficRouterStatus

type TrafficRouterStatus struct {
}

HttpRequestMatchRuleStatus defines the observed state of HttpRequestMatchRule.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL