类型
object

规格

属性类型描述
specobject

Configuration affecting label/content routing, sni routing, etc. See more details at: https://istio.io/docs/reference/config/networking/virtual-service.html

statusobject

.spec

描述
Configuration affecting label/content routing, sni routing, etc. See more details at: https://istio.io/docs/reference/config/networking/virtual-service.html
类型
object
属性类型描述
exportToarray

A list of namespaces to which this virtual service is exported.

gatewaysarray

The names of gateways and sidecars that should apply these routes.

hostsarray

The destination hosts to which traffic is being sent.

httparray

An ordered list of route rules for HTTP traffic.

tcparray

An ordered list of route rules for opaque TCP traffic.

tlsarray

.spec.exportTo

描述
A list of namespaces to which this virtual service is exported.
类型
array

.spec.exportTo[]

类型
string

.spec.gateways

描述
The names of gateways and sidecars that should apply these routes.
类型
array

.spec.gateways[]

类型
string

.spec.hosts

描述
The destination hosts to which traffic is being sent.
类型
array

.spec.hosts[]

类型
string

.spec.http

描述
An ordered list of route rules for HTTP traffic.
类型
array

.spec.http[]

类型
object
属性类型描述
corsPolicyobject

Cross-Origin Resource Sharing policy (CORS).

delegateobject
directResponseobject

A HTTP rule can either return a direct_response, redirect or forward (default) traffic.

faultobject

Fault injection policy to apply on HTTP traffic at the client side.

headersobject
matcharray
mirrorobject
mirror_percentinteger

Percentage of the traffic to be mirrored by the mirror field.

mirrorPercentinteger

Percentage of the traffic to be mirrored by the mirror field.

mirrorPercentageobject

Percentage of the traffic to be mirrored by the mirror field.

namestring

The name assigned to the route for debugging purposes.

redirectobject

A HTTP rule can either return a direct_response, redirect or forward (default) traffic.

retriesobject

Retry policy for HTTP requests.

rewriteobject

Rewrite HTTP URIs and Authority headers.

routearray

A HTTP rule can either return a direct_response, redirect or forward (default) traffic.

timeoutstring

Timeout for HTTP requests, default is disabled.

.spec.http[].corsPolicy

描述
Cross-Origin Resource Sharing policy (CORS).
类型
object
属性类型描述
allowCredentialsboolean
allowHeadersarray
allowMethodsarray

List of HTTP methods allowed to access the resource.

allowOriginarray

The list of origins that are allowed to perform CORS requests.

allowOriginsarray

String patterns that match allowed origins.

exposeHeadersarray
maxAgestring

.spec.http[].corsPolicy.allowHeaders

类型
array

.spec.http[].corsPolicy.allowHeaders[]

类型
string

.spec.http[].corsPolicy.allowMethods

描述
List of HTTP methods allowed to access the resource.
类型
array

.spec.http[].corsPolicy.allowMethods[]

类型
string

.spec.http[].corsPolicy.allowOrigin

描述
The list of origins that are allowed to perform CORS requests.
类型
array

.spec.http[].corsPolicy.allowOrigin[]

类型
string

.spec.http[].corsPolicy.allowOrigins

描述
String patterns that match allowed origins.
类型
array

.spec.http[].corsPolicy.allowOrigins[]

类型
object
属性类型描述
exactstring
prefixstring
regexstring

RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).

.spec.http[].corsPolicy.exposeHeaders

类型
array

.spec.http[].corsPolicy.exposeHeaders[]

类型
string

.spec.http[].delegate

类型
object
属性类型描述
namestring

Name specifies the name of the delegate VirtualService.

namespacestring

Namespace specifies the namespace where the delegate VirtualService resides.

.spec.http[].directResponse

描述
A HTTP rule can either return a direct_response, redirect or forward (default) traffic.
类型
object
属性类型描述
bodyobject

Specifies the content of the response body.

statusinteger

Specifies the HTTP response status to be returned.

.spec.http[].directResponse.body

描述
Specifies the content of the response body.
类型
object
属性类型描述
bytesstring

response body as base64 encoded bytes.

stringstring

.spec.http[].fault

描述
Fault injection policy to apply on HTTP traffic at the client side.
类型
object
属性类型描述
abortobject
delayobject

.spec.http[].fault.abort

类型
object
属性类型描述
grpcStatusstring

GRPC status code to use to abort the request.

http2Errorstring
httpStatusinteger

HTTP status code to use to abort the Http request.

percentageobject

Percentage of requests to be aborted with the error code provided.

.spec.http[].fault.abort.percentage

描述
Percentage of requests to be aborted with the error code provided.
类型
object
属性类型描述
valuenumber

.spec.http[].fault.delay

类型
object
属性类型描述
exponentialDelaystring
fixedDelaystring

Add a fixed delay before forwarding the request.

percentinteger

Percentage of requests on which the delay will be injected (0-100).

percentageobject

Percentage of requests on which the delay will be injected.

.spec.http[].fault.delay.percentage

描述
Percentage of requests on which the delay will be injected.
类型
object
属性类型描述
valuenumber

.spec.http[].headers

类型
object
属性类型描述
requestobject
responseobject

.spec.http[].headers.request

类型
object
属性类型描述
addobject
removearray
setobject

.spec.http[].headers.request.add

类型
object

.spec.http[].headers.request.remove

类型
array

.spec.http[].headers.request.remove[]

类型
string

.spec.http[].headers.request.set

类型
object

.spec.http[].headers.response

类型
object
属性类型描述
addobject
removearray
setobject

.spec.http[].headers.response.add

类型
object

.spec.http[].headers.response.remove

类型
array

.spec.http[].headers.response.remove[]

类型
string

.spec.http[].headers.response.set

类型
object

.spec.http[].match

类型
array

.spec.http[].match[]

类型
object
属性类型描述
authorityobject
gatewaysarray

Names of gateways where the rule should be applied.

headersobject
ignoreUriCaseboolean

Flag to specify whether the URI matching should be case-insensitive.

methodobject
namestring

The name assigned to a match.

portinteger

Specifies the ports on the host that is being addressed.

queryParamsobject

Query parameters for matching.

schemeobject
sourceLabelsobject
sourceNamespacestring

Source namespace constraining the applicability of a rule to workloads in that namespace.

statPrefixstring

The human readable prefix to use when emitting statistics for this route.

uriobject
withoutHeadersobject

withoutHeader has the same syntax with the header, but has opposite meaning.

.spec.http[].match[].authority

类型
object
属性类型描述
exactstring
prefixstring
regexstring

RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).

.spec.http[].match[].gateways

描述
Names of gateways where the rule should be applied.
类型
array

.spec.http[].match[].gateways[]

类型
string

.spec.http[].match[].headers

类型
object

.spec.http[].match[].method

类型
object
属性类型描述
exactstring
prefixstring
regexstring

RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).

.spec.http[].match[].queryParams

描述
Query parameters for matching.
类型
object

.spec.http[].match[].scheme

类型
object
属性类型描述
exactstring
prefixstring
regexstring

RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).

.spec.http[].match[].sourceLabels

类型
object

.spec.http[].match[].uri

类型
object
属性类型描述
exactstring
prefixstring
regexstring

RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).

.spec.http[].match[].withoutHeaders

描述
withoutHeader has the same syntax with the header, but has opposite meaning.
类型
object

.spec.http[].mirror

类型
object
属性类型描述
hoststring

The name of a service from the service registry.

portobject

Specifies the port on the host that is being addressed.

subsetstring

The name of a subset within the service.

.spec.http[].mirror.port

描述
Specifies the port on the host that is being addressed.
类型
object
属性类型描述
numberinteger

.spec.http[].mirrorPercentage

描述
Percentage of the traffic to be mirrored by the `mirror` field.
类型
object
属性类型描述
valuenumber

.spec.http[].redirect

描述
A HTTP rule can either return a direct_response, redirect or forward (default) traffic.
类型
object
属性类型描述
authoritystring
derivePortstring
portinteger

On a redirect, overwrite the port portion of the URL with this value.

redirectCodeinteger
schemestring

On a redirect, overwrite the scheme portion of the URL with this value.

uristring

.spec.http[].retries

描述
Retry policy for HTTP requests.
类型
object
属性类型描述
attemptsinteger

Number of retries to be allowed for a given request.

perTryTimeoutstring

Timeout per attempt for a given request, including the initial call and any retries.

retryOnstring

Specifies the conditions under which retry takes place.

retryRemoteLocalitiesboolean

Flag to specify whether the retries should retry to other localities.

.spec.http[].rewrite

描述
Rewrite HTTP URIs and Authority headers.
类型
object
属性类型描述
authoritystring

rewrite the Authority/Host header with this value.

uristring

.spec.http[].route

描述
A HTTP rule can either return a direct_response, redirect or forward (default) traffic.
类型
array

.spec.http[].route[]

类型
object
属性类型描述
destinationobject
headersobject
weightinteger

Weight specifies the relative proportion of traffic to be forwarded to the destination.

.spec.http[].route[].destination

类型
object
属性类型描述
hoststring

The name of a service from the service registry.

portobject

Specifies the port on the host that is being addressed.

subsetstring

The name of a subset within the service.

.spec.http[].route[].destination.port

描述
Specifies the port on the host that is being addressed.
类型
object
属性类型描述
numberinteger

.spec.http[].route[].headers

类型
object
属性类型描述
requestobject
responseobject

.spec.http[].route[].headers.request

类型
object
属性类型描述
addobject
removearray
setobject

.spec.http[].route[].headers.request.add

类型
object

.spec.http[].route[].headers.request.remove

类型
array

.spec.http[].route[].headers.request.remove[]

类型
string

.spec.http[].route[].headers.request.set

类型
object

.spec.http[].route[].headers.response

类型
object
属性类型描述
addobject
removearray
setobject

.spec.http[].route[].headers.response.add

类型
object

.spec.http[].route[].headers.response.remove

类型
array

.spec.http[].route[].headers.response.remove[]

类型
string

.spec.http[].route[].headers.response.set

类型
object

.spec.tcp

描述
An ordered list of route rules for opaque TCP traffic.
类型
array

.spec.tcp[]

类型
object
属性类型描述
matcharray
routearray

The destination to which the connection should be forwarded to.

.spec.tcp[].match

类型
array

.spec.tcp[].match[]

类型
object
属性类型描述
destinationSubnetsarray

IPv4 or IPv6 ip addresses of destination with optional subnet.

gatewaysarray

Names of gateways where the rule should be applied.

portinteger

Specifies the port on the host that is being addressed.

sourceLabelsobject
sourceNamespacestring

Source namespace constraining the applicability of a rule to workloads in that namespace.

sourceSubnetstring

IPv4 or IPv6 ip address of source with optional subnet.

.spec.tcp[].match[].destinationSubnets

描述
IPv4 or IPv6 ip addresses of destination with optional subnet.
类型
array

.spec.tcp[].match[].destinationSubnets[]

类型
string

.spec.tcp[].match[].gateways

描述
Names of gateways where the rule should be applied.
类型
array

.spec.tcp[].match[].gateways[]

类型
string

.spec.tcp[].match[].sourceLabels

类型
object

.spec.tcp[].route

描述
The destination to which the connection should be forwarded to.
类型
array

.spec.tcp[].route[]

类型
object
属性类型描述
destinationobject
weightinteger

Weight specifies the relative proportion of traffic to be forwarded to the destination.

.spec.tcp[].route[].destination

类型
object
属性类型描述
hoststring

The name of a service from the service registry.

portobject

Specifies the port on the host that is being addressed.

subsetstring

The name of a subset within the service.

.spec.tcp[].route[].destination.port

描述
Specifies the port on the host that is being addressed.
类型
object
属性类型描述
numberinteger

.spec.tls

类型
array

.spec.tls[]

类型
object
属性类型描述
matcharray
routearray

The destination to which the connection should be forwarded to.

.spec.tls[].match

类型
array

.spec.tls[].match[]

类型
object
属性类型描述
destinationSubnetsarray

IPv4 or IPv6 ip addresses of destination with optional subnet.

gatewaysarray

Names of gateways where the rule should be applied.

portinteger

Specifies the port on the host that is being addressed.

sniHostsarray

SNI (server name indicator) to match on.

sourceLabelsobject
sourceNamespacestring

Source namespace constraining the applicability of a rule to workloads in that namespace.

.spec.tls[].match[].destinationSubnets

描述
IPv4 or IPv6 ip addresses of destination with optional subnet.
类型
array

.spec.tls[].match[].destinationSubnets[]

类型
string

.spec.tls[].match[].gateways

描述
Names of gateways where the rule should be applied.
类型
array

.spec.tls[].match[].gateways[]

类型
string

.spec.tls[].match[].sniHosts

描述
SNI (server name indicator) to match on.
类型
array

.spec.tls[].match[].sniHosts[]

类型
string

.spec.tls[].match[].sourceLabels

类型
object

.spec.tls[].route

描述
The destination to which the connection should be forwarded to.
类型
array

.spec.tls[].route[]

类型
object
属性类型描述
destinationobject
weightinteger

Weight specifies the relative proportion of traffic to be forwarded to the destination.

.spec.tls[].route[].destination

类型
object
属性类型描述
hoststring

The name of a service from the service registry.

portobject

Specifies the port on the host that is being addressed.

subsetstring

The name of a subset within the service.

.spec.tls[].route[].destination.port

描述
Specifies the port on the host that is being addressed.
类型
object
属性类型描述
numberinteger

.status

类型
object

API 端点

可用的 API 端点如下:

  • /apis/networking.istio.io/v1beta1/namespaces/{namespace}/virtualservices
    • DELETE: delete collection of VirtualService
    • GET: list objects of kind VirtualService
    • POST: create a new VirtualService
  • /apis/networking.istio.io/v1beta1/namespaces/{namespace}/virtualservices/{name}
    • DELETE: delete the specified VirtualService
    • GET: read the specified VirtualService
    • PATCH: partially update the specified VirtualService
    • PUT: replace the specified VirtualService
  • /apis/networking.istio.io/v1beta1/namespaces/{namespace}/virtualservices/{name}/status
    • GET: read status of the specified VirtualService
    • PATCH: partially update status of the specified VirtualService
    • PUT: replace status of the specified VirtualService

/apis/networking.istio.io/v1beta1/namespaces/{namespace}/virtualservices

HTTP 方法
DELETE
描述
delete collection of VirtualService
HTTP 响应
HTTP 状态码响应体
200 - OKStatus schema
401 - UnauthorizedEmpty
HTTP 方法
GET
描述
list objects of kind VirtualService
HTTP 响应
HTTP 状态码响应体
200 - OKVirtualServiceList schema
401 - UnauthorizedEmpty
HTTP 方法
POST
描述
create a new VirtualService
查询参数
参数类型描述
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
fieldValidationstringfieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
请求体参数
参数类型描述
bodyVirtualService schemaapplication/json formatted
HTTP 响应
HTTP 状态码响应体
200 - OKVirtualService schema
201 - CreatedVirtualService schema
202 - AcceptedVirtualService schema
401 - UnauthorizedEmpty

/apis/networking.istio.io/v1beta1/namespaces/{namespace}/virtualservices/{name}

HTTP 方法
DELETE
描述
delete the specified VirtualService
查询参数
参数类型描述
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
HTTP 响应
HTTP 状态码响应体
200 - OKStatus schema
202 - AcceptedStatus schema
401 - UnauthorizedEmpty
HTTP 方法
GET
描述
read the specified VirtualService
HTTP 响应
HTTP 状态码响应体
200 - OKVirtualService schema
401 - UnauthorizedEmpty
HTTP 方法
PATCH
描述
partially update the specified VirtualService
查询参数
参数类型描述
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
fieldValidationstringfieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
HTTP 响应
HTTP 状态码响应体
200 - OKVirtualService schema
401 - UnauthorizedEmpty
HTTP 方法
PUT
描述
replace the specified VirtualService
查询参数
参数类型描述
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
fieldValidationstringfieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
请求体参数
参数类型描述
bodyVirtualService schemaapplication/json formatted
HTTP 响应
HTTP 状态码响应体
200 - OKVirtualService schema
201 - CreatedVirtualService schema
401 - UnauthorizedEmpty

/apis/networking.istio.io/v1beta1/namespaces/{namespace}/virtualservices/{name}/status

HTTP 方法
GET
描述
read status of the specified VirtualService
HTTP 响应
HTTP 状态码响应体
200 - OKVirtualService schema
401 - UnauthorizedEmpty
HTTP 方法
PATCH
描述
partially update status of the specified VirtualService
查询参数
参数类型描述
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
fieldValidationstringfieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
HTTP 响应
HTTP 状态码响应体
200 - OKVirtualService schema
401 - UnauthorizedEmpty
HTTP 方法
PUT
描述
replace status of the specified VirtualService
查询参数
参数类型描述
dryRunstringWhen present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
fieldValidationstringfieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.
请求体参数
参数类型描述
bodyVirtualService schemaapplication/json formatted
HTTP 响应
HTTP 状态码响应体
200 - OKVirtualService schema
201 - CreatedVirtualService schema
401 - UnauthorizedEmpty