{ "properties": { "spec": { "description": "Configuration affecting label/content routing, sni routing, etc. See more details at: https://istio.io/docs/reference/config/networking/virtual-service.html", "properties": { "exportTo": { "description": "A list of namespaces to which this virtual service is exported.", "items": { "type": "string" }, "type": "array" }, "gateways": { "description": "The names of gateways and sidecars that should apply these routes.", "items": { "type": "string" }, "type": "array" }, "hosts": { "description": "The destination hosts to which traffic is being sent.", "items": { "type": "string" }, "type": "array" }, "http": { "description": "An ordered list of route rules for HTTP traffic.", "items": { "type": "object", "properties": { "corsPolicy": { "description": "Cross-Origin Resource Sharing policy (CORS).", "type": "object", "properties": { "allowCredentials": { "description": "Indicates whether the caller is allowed to send the actual request (not the preflight) using credentials.", "type": "boolean", "nullable": true }, "allowHeaders": { "description": "List of HTTP headers that can be used when requesting the resource.", "type": "array", "items": { "type": "string" } }, "allowMethods": { "description": "List of HTTP methods allowed to access the resource.", "type": "array", "items": { "type": "string" } }, "allowOrigin": { "type": "array", "items": { "type": "string" } }, "allowOrigins": { "description": "String patterns that match allowed origins.", "type": "array", "items": { "type": "object", "oneOf": [ { "not": { "anyOf": [ { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ] } }, { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ], "properties": { "exact": { "type": "string" }, "prefix": { "type": "string" }, "regex": { "description": "[RE2 style regex-based match](https://github.com/google/re2/wiki/Syntax).", "type": "string" } } } }, "exposeHeaders": { "description": "A list of HTTP headers that the browsers are allowed to access.", "type": "array", "items": { "type": "string" } }, "maxAge": { "description": "Specifies how long the results of a preflight request can be cached.", "type": "string", "x-kubernetes-validations": [ { "rule": "duration(self) >= duration('1ms')", "message": "must be a valid duration greater than 1ms" } ] }, "unmatchedPreflights": { "description": "Indicates whether preflight requests not matching the configured allowed origin shouldn't be forwarded to the upstream.\n\nValid Options: FORWARD, IGNORE", "type": "string", "enum": [ "UNSPECIFIED", "FORWARD", "IGNORE" ] } } }, "delegate": { "description": "Delegate is used to specify the particular VirtualService which can be used to define delegate HTTPRoute.", "type": "object", "properties": { "name": { "description": "Name specifies the name of the delegate VirtualService.", "type": "string" }, "namespace": { "description": "Namespace specifies the namespace where the delegate VirtualService resides.", "type": "string" } } }, "directResponse": { "description": "A HTTP rule can either return a direct_response, redirect or forward (default) traffic.", "type": "object", "required": [ "status" ], "properties": { "body": { "description": "Specifies the content of the response body.", "type": "object", "oneOf": [ { "not": { "anyOf": [ { "required": [ "string" ] }, { "required": [ "bytes" ] } ] } }, { "required": [ "string" ] }, { "required": [ "bytes" ] } ], "properties": { "bytes": { "description": "response body as base64 encoded bytes.", "type": "string", "format": "binary" }, "string": { "type": "string" } } }, "status": { "description": "Specifies the HTTP response status to be returned.", "type": "integer", "maximum": 4294967295, "minimum": 0 } } }, "fault": { "description": "Fault injection policy to apply on HTTP traffic at the client side.", "type": "object", "properties": { "abort": { "description": "Abort Http request attempts and return error codes back to downstream service, giving the impression that the upstream service is faulty.", "type": "object", "oneOf": [ { "not": { "anyOf": [ { "required": [ "httpStatus" ] }, { "required": [ "grpcStatus" ] }, { "required": [ "http2Error" ] } ] } }, { "required": [ "httpStatus" ] }, { "required": [ "grpcStatus" ] }, { "required": [ "http2Error" ] } ], "properties": { "grpcStatus": { "description": "GRPC status code to use to abort the request.", "type": "string" }, "http2Error": { "type": "string" }, "httpStatus": { "description": "HTTP status code to use to abort the Http request.", "type": "integer", "format": "int32" }, "percentage": { "description": "Percentage of requests to be aborted with the error code provided.", "type": "object", "properties": { "value": { "type": "number", "format": "double" } } } } }, "delay": { "description": "Delay requests before forwarding, emulating various failures such as network issues, overloaded upstream service, etc.", "type": "object", "oneOf": [ { "not": { "anyOf": [ { "required": [ "fixedDelay" ] }, { "required": [ "exponentialDelay" ] } ] } }, { "required": [ "fixedDelay" ] }, { "required": [ "exponentialDelay" ] } ], "properties": { "exponentialDelay": { "type": "string", "x-kubernetes-validations": [ { "rule": "duration(self) >= duration('1ms')", "message": "must be a valid duration greater than 1ms" } ] }, "fixedDelay": { "description": "Add a fixed delay before forwarding the request.", "type": "string", "x-kubernetes-validations": [ { "rule": "duration(self) >= duration('1ms')", "message": "must be a valid duration greater than 1ms" } ] }, "percent": { "description": "Percentage of requests on which the delay will be injected (0-100).", "type": "integer", "format": "int32" }, "percentage": { "description": "Percentage of requests on which the delay will be injected.", "type": "object", "properties": { "value": { "type": "number", "format": "double" } } } } } } }, "headers": { "type": "object", "properties": { "request": { "type": "object", "properties": { "add": { "type": "object", "additionalProperties": { "type": "string" } }, "remove": { "type": "array", "items": { "type": "string" } }, "set": { "type": "object", "additionalProperties": { "type": "string" } } } }, "response": { "type": "object", "properties": { "add": { "type": "object", "additionalProperties": { "type": "string" } }, "remove": { "type": "array", "items": { "type": "string" } }, "set": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "match": { "description": "Match conditions to be satisfied for the rule to be activated.", "type": "array", "items": { "type": "object", "properties": { "authority": { "description": "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).", "type": "object", "oneOf": [ { "not": { "anyOf": [ { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ] } }, { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ], "properties": { "exact": { "type": "string" }, "prefix": { "type": "string" }, "regex": { "description": "[RE2 style regex-based match](https://github.com/google/re2/wiki/Syntax).", "type": "string" } } }, "gateways": { "description": "Names of gateways where the rule should be applied.", "type": "array", "items": { "type": "string" } }, "headers": { "description": "The header keys must be lowercase and use hyphen as the separator, e.g.", "type": "object", "additionalProperties": { "type": "object", "oneOf": [ { "not": { "anyOf": [ { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ] } }, { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ], "properties": { "exact": { "type": "string" }, "prefix": { "type": "string" }, "regex": { "description": "[RE2 style regex-based match](https://github.com/google/re2/wiki/Syntax).", "type": "string" } } } }, "ignoreUriCase": { "description": "Flag to specify whether the URI matching should be case-insensitive.", "type": "boolean" }, "method": { "description": "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).", "type": "object", "oneOf": [ { "not": { "anyOf": [ { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ] } }, { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ], "properties": { "exact": { "type": "string" }, "prefix": { "type": "string" }, "regex": { "description": "[RE2 style regex-based match](https://github.com/google/re2/wiki/Syntax).", "type": "string" } } }, "name": { "description": "The name assigned to a match.", "type": "string" }, "port": { "description": "Specifies the ports on the host that is being addressed.", "type": "integer", "maximum": 4294967295, "minimum": 0 }, "queryParams": { "description": "Query parameters for matching.", "type": "object", "additionalProperties": { "type": "object", "oneOf": [ { "not": { "anyOf": [ { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ] } }, { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ], "properties": { "exact": { "type": "string" }, "prefix": { "type": "string" }, "regex": { "description": "[RE2 style regex-based match](https://github.com/google/re2/wiki/Syntax).", "type": "string" } } } }, "scheme": { "description": "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).", "type": "object", "oneOf": [ { "not": { "anyOf": [ { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ] } }, { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ], "properties": { "exact": { "type": "string" }, "prefix": { "type": "string" }, "regex": { "description": "[RE2 style regex-based match](https://github.com/google/re2/wiki/Syntax).", "type": "string" } } }, "sourceLabels": { "description": "One or more labels that constrain the applicability of a rule to source (client) workloads with the given labels.", "type": "object", "additionalProperties": { "type": "string" } }, "sourceNamespace": { "description": "Source namespace constraining the applicability of a rule to workloads in that namespace.", "type": "string" }, "statPrefix": { "description": "The human readable prefix to use when emitting statistics for this route.", "type": "string" }, "uri": { "description": "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).", "type": "object", "oneOf": [ { "not": { "anyOf": [ { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ] } }, { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ], "properties": { "exact": { "type": "string" }, "prefix": { "type": "string" }, "regex": { "description": "[RE2 style regex-based match](https://github.com/google/re2/wiki/Syntax).", "type": "string" } } }, "withoutHeaders": { "description": "withoutHeader has the same syntax with the header, but has opposite meaning.", "type": "object", "additionalProperties": { "type": "object", "oneOf": [ { "not": { "anyOf": [ { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ] } }, { "required": [ "exact" ] }, { "required": [ "prefix" ] }, { "required": [ "regex" ] } ], "properties": { "exact": { "type": "string" }, "prefix": { "type": "string" }, "regex": { "description": "[RE2 style regex-based match](https://github.com/google/re2/wiki/Syntax).", "type": "string" } } } } } } }, "mirror": { "description": "Mirror HTTP traffic to a another destination in addition to forwarding the requests to the intended destination.", "type": "object", "required": [ "host" ], "properties": { "host": { "description": "The name of a service from the service registry.", "type": "string" }, "port": { "description": "Specifies the port on the host that is being addressed.", "type": "object", "properties": { "number": { "type": "integer", "maximum": 4294967295, "minimum": 0 } } }, "subset": { "description": "The name of a subset within the service.", "type": "string" } } }, "mirrorPercent": { "type": "integer", "maximum": 4294967295, "minimum": 0, "nullable": true }, "mirrorPercentage": { "description": "Percentage of the traffic to be mirrored by the `mirror` field.", "type": "object", "properties": { "value": { "type": "number", "format": "double" } } }, "mirror_percent": { "type": "integer", "maximum": 4294967295, "minimum": 0, "nullable": true }, "mirrors": { "description": "Specifies the destinations to mirror HTTP traffic in addition to the original destination.", "type": "array", "items": { "type": "object", "required": [ "destination" ], "properties": { "destination": { "description": "Destination specifies the target of the mirror operation.", "type": "object", "required": [ "host" ], "properties": { "host": { "description": "The name of a service from the service registry.", "type": "string" }, "port": { "description": "Specifies the port on the host that is being addressed.", "type": "object", "properties": { "number": { "type": "integer", "maximum": 4294967295, "minimum": 0 } } }, "subset": { "description": "The name of a subset within the service.", "type": "string" } } }, "percentage": { "description": "Percentage of the traffic to be mirrored by the `destination` field.", "type": "object", "properties": { "value": { "type": "number", "format": "double" } } } } } }, "name": { "description": "The name assigned to the route for debugging purposes.", "type": "string" }, "redirect": { "description": "A HTTP rule can either return a direct_response, redirect or forward (default) traffic.", "type": "object", "oneOf": [ { "not": { "anyOf": [ { "required": [ "port" ] }, { "required": [ "derivePort" ] } ] } }, { "required": [ "port" ] }, { "required": [ "derivePort" ] } ], "properties": { "authority": { "description": "On a redirect, overwrite the Authority/Host portion of the URL with this value.", "type": "string" }, "derivePort": { "description": "On a redirect, dynamically set the port: * FROM_PROTOCOL_DEFAULT: automatically set to 80 for HTTP and 443 for HTTPS.\n\nValid Options: FROM_PROTOCOL_DEFAULT, FROM_REQUEST_PORT", "type": "string", "enum": [ "FROM_PROTOCOL_DEFAULT", "FROM_REQUEST_PORT" ] }, "port": { "description": "On a redirect, overwrite the port portion of the URL with this value.", "type": "integer", "maximum": 4294967295, "minimum": 0 }, "redirectCode": { "description": "On a redirect, Specifies the HTTP status code to use in the redirect response.", "type": "integer", "maximum": 4294967295, "minimum": 0 }, "scheme": { "description": "On a redirect, overwrite the scheme portion of the URL with this value.", "type": "string" }, "uri": { "description": "On a redirect, overwrite the Path portion of the URL with this value.", "type": "string" } } }, "retries": { "description": "Retry policy for HTTP requests.", "type": "object", "properties": { "attempts": { "description": "Number of retries to be allowed for a given request.", "type": "integer", "format": "int32" }, "perTryTimeout": { "description": "Timeout per attempt for a given request, including the initial call and any retries.", "type": "string", "x-kubernetes-validations": [ { "rule": "duration(self) >= duration('1ms')", "message": "must be a valid duration greater than 1ms" } ] }, "retryOn": { "description": "Specifies the conditions under which retry takes place.", "type": "string" }, "retryRemoteLocalities": { "description": "Flag to specify whether the retries should retry to other localities.", "type": "boolean", "nullable": true } } }, "rewrite": { "description": "Rewrite HTTP URIs and Authority headers.", "type": "object", "properties": { "authority": { "description": "rewrite the Authority/Host header with this value.", "type": "string" }, "uri": { "description": "rewrite the path (or the prefix) portion of the URI with this value.", "type": "string" }, "uriRegexRewrite": { "description": "rewrite the path portion of the URI with the specified regex.", "type": "object", "properties": { "match": { "description": "[RE2 style regex-based match](https://github.com/google/re2/wiki/Syntax).", "type": "string" }, "rewrite": { "description": "The string that should replace into matching portions of original URI.", "type": "string" } } } } }, "route": { "description": "A HTTP rule can either return a direct_response, redirect or forward (default) traffic.", "type": "array", "items": { "type": "object", "required": [ "destination" ], "properties": { "destination": { "description": "Destination uniquely identifies the instances of a service to which the request/connection should be forwarded to.", "type": "object", "required": [ "host" ], "properties": { "host": { "description": "The name of a service from the service registry.", "type": "string" }, "port": { "description": "Specifies the port on the host that is being addressed.", "type": "object", "properties": { "number": { "type": "integer", "maximum": 4294967295, "minimum": 0 } } }, "subset": { "description": "The name of a subset within the service.", "type": "string" } } }, "headers": { "type": "object", "properties": { "request": { "type": "object", "properties": { "add": { "type": "object", "additionalProperties": { "type": "string" } }, "remove": { "type": "array", "items": { "type": "string" } }, "set": { "type": "object", "additionalProperties": { "type": "string" } } } }, "response": { "type": "object", "properties": { "add": { "type": "object", "additionalProperties": { "type": "string" } }, "remove": { "type": "array", "items": { "type": "string" } }, "set": { "type": "object", "additionalProperties": { "type": "string" } } } } } }, "weight": { "description": "Weight specifies the relative proportion of traffic to be forwarded to the destination.", "type": "integer", "format": "int32" } } } }, "timeout": { "description": "Timeout for HTTP requests, default is disabled.", "type": "string", "x-kubernetes-validations": [ { "rule": "duration(self) >= duration('1ms')", "message": "must be a valid duration greater than 1ms" } ] } } }, "type": "array" }, "tcp": { "description": "An ordered list of route rules for opaque TCP traffic.", "items": { "type": "object", "properties": { "match": { "description": "Match conditions to be satisfied for the rule to be activated.", "type": "array", "items": { "type": "object", "properties": { "destinationSubnets": { "description": "IPv4 or IPv6 ip addresses of destination with optional subnet.", "type": "array", "items": { "type": "string" } }, "gateways": { "description": "Names of gateways where the rule should be applied.", "type": "array", "items": { "type": "string" } }, "port": { "description": "Specifies the port on the host that is being addressed.", "type": "integer", "maximum": 4294967295, "minimum": 0 }, "sourceLabels": { "description": "One or more labels that constrain the applicability of a rule to workloads with the given labels.", "type": "object", "additionalProperties": { "type": "string" } }, "sourceNamespace": { "description": "Source namespace constraining the applicability of a rule to workloads in that namespace.", "type": "string" }, "sourceSubnet": { "type": "string" } } } }, "route": { "description": "The destination to which the connection should be forwarded to.", "type": "array", "items": { "type": "object", "required": [ "destination" ], "properties": { "destination": { "description": "Destination uniquely identifies the instances of a service to which the request/connection should be forwarded to.", "type": "object", "required": [ "host" ], "properties": { "host": { "description": "The name of a service from the service registry.", "type": "string" }, "port": { "description": "Specifies the port on the host that is being addressed.", "type": "object", "properties": { "number": { "type": "integer", "maximum": 4294967295, "minimum": 0 } } }, "subset": { "description": "The name of a subset within the service.", "type": "string" } } }, "weight": { "description": "Weight specifies the relative proportion of traffic to be forwarded to the destination.", "type": "integer", "format": "int32" } } } } } }, "type": "array" }, "tls": { "description": "An ordered list of route rule for non-terminated TLS & HTTPS traffic.", "items": { "type": "object", "required": [ "match" ], "properties": { "match": { "description": "Match conditions to be satisfied for the rule to be activated.", "type": "array", "items": { "type": "object", "required": [ "sniHosts" ], "properties": { "destinationSubnets": { "description": "IPv4 or IPv6 ip addresses of destination with optional subnet.", "type": "array", "items": { "type": "string" } }, "gateways": { "description": "Names of gateways where the rule should be applied.", "type": "array", "items": { "type": "string" } }, "port": { "description": "Specifies the port on the host that is being addressed.", "type": "integer", "maximum": 4294967295, "minimum": 0 }, "sniHosts": { "description": "SNI (server name indicator) to match on.", "type": "array", "items": { "type": "string" } }, "sourceLabels": { "description": "One or more labels that constrain the applicability of a rule to workloads with the given labels.", "type": "object", "additionalProperties": { "type": "string" } }, "sourceNamespace": { "description": "Source namespace constraining the applicability of a rule to workloads in that namespace.", "type": "string" } } } }, "route": { "description": "The destination to which the connection should be forwarded to.", "type": "array", "items": { "type": "object", "required": [ "destination" ], "properties": { "destination": { "description": "Destination uniquely identifies the instances of a service to which the request/connection should be forwarded to.", "type": "object", "required": [ "host" ], "properties": { "host": { "description": "The name of a service from the service registry.", "type": "string" }, "port": { "description": "Specifies the port on the host that is being addressed.", "type": "object", "properties": { "number": { "type": "integer", "maximum": 4294967295, "minimum": 0 } } }, "subset": { "description": "The name of a subset within the service.", "type": "string" } } }, "weight": { "description": "Weight specifies the relative proportion of traffic to be forwarded to the destination.", "type": "integer", "format": "int32" } } } } } }, "type": "array" } }, "type": "object" }, "status": { "properties": { "conditions": { "description": "Current service state of the resource.", "items": { "type": "object", "properties": { "lastProbeTime": { "description": "Last time we probed the condition.", "type": "string", "format": "date-time" }, "lastTransitionTime": { "description": "Last time the condition transitioned from one status to another.", "type": "string", "format": "date-time" }, "message": { "description": "Human-readable message indicating details about last transition.", "type": "string" }, "reason": { "description": "Unique, one-word, CamelCase reason for the condition's last transition.", "type": "string" }, "status": { "description": "Status is the status of the condition.", "type": "string" }, "type": { "description": "Type is the type of the condition.", "type": "string" } } }, "type": "array" }, "observedGeneration": { "anyOf": [ { "type": "integer" }, { "type": "string" } ], "description": "Resource Generation to which the Reconciled Condition refers.", "x_kubernetes_int_or_string": true }, "validationMessages": { "description": "Includes any errors or warnings detected by Istio's analyzers.", "items": { "type": "object", "properties": { "documentationUrl": { "description": "A url pointing to the Istio documentation for this specific error type.", "type": "string" }, "level": { "description": "Represents how severe a message is.\n\nValid Options: UNKNOWN, ERROR, WARNING, INFO", "type": "string", "enum": [ "UNKNOWN", "ERROR", "WARNING", "INFO" ] }, "type": { "type": "object", "properties": { "code": { "description": "A 7 character code matching `^IST[0-9]{4}$` intended to uniquely identify the message type.", "type": "string" }, "name": { "description": "A human-readable name for the message type.", "type": "string" } } } } }, "type": "array" } }, "type": "object", "x_kubernetes_preserve_unknown_fields": true } }, "type": "object" }