MeshHTTPRoute 정책 구성 참조
MeshHTTPRoute 정책 구성 참조 (MeshHttpRoutes Policy Configuration Reference)
이 문서는 Kong Mesh에서 MeshHTTPRoute 정책을 구성할 때 참고하는 스키마를 정리한 참조 문서예요. targetRef 필드로 정책이 적용될 대상 리소스를 지정하는 방법과 kind, labels, tags 같은 세부 옵션의 역할을 하나씩 확인할 수 있어요. 아울러 to 항목으로 요청의 목적지 서비스를 매칭하고 라우팅 설정을 담는 구조도 함께 설명하고 있어요. MeshHTTPRoute 리소스의 사양을 JSON 형태로 그대로 살펴보고 싶을 때 유용한 자료예요
출처: 문서
본문
구성
{
"description": "Spec is the specification of the Kuma MeshHTTPRoute resource.",
"properties": {
"targetRef": {
"description": "TargetRef is a reference to the resource the policy takes an effect on.\nThe resource could be either a real store object or virtual resource\ndefined inplace.",
"properties": {
"kind": {
"description": "Kind of the referenced resource",
"enum": [
"Mesh",
"MeshSubset",
"MeshGateway",
"MeshService",
"MeshExternalService",
"MeshMultiZoneService",
"MeshServiceSubset",
"MeshHTTPRoute",
"Dataplane"
],
"type": "string"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"description": "Labels are used to select group of MeshServices that match labels. Either Labels or\nName and Namespace can be used.",
"type": "object"
},
"mesh": {
"description": "Mesh is reserved for future use to identify cross mesh resources.",
"type": "string"
},
"name": {
"description": "Name of the referenced resource. Can only be used with kinds: `MeshService`,\n`MeshServiceSubset` and `MeshGatewayRoute`",
"type": "string"
},
"namespace": {
"description": "Namespace specifies the namespace of target resource. If empty only resources in policy namespace\nwill be targeted.",
"type": "string"
},
"proxyTypes": {
"description": "ProxyTypes specifies the data plane types that are subject to the policy. When not specified,\nall data plane types are targeted by the policy.",
"items": {
"enum": [
"Sidecar",
"Gateway"
],
"type": "string"
},
"type": "array"
},
"sectionName": {
"description": "SectionName is used to target specific section of resource.\nFor example, you can target port from MeshService.ports[] by its name. Only traffic to this port will be affected.",
"type": "string"
},
"tags": {
"additionalProperties": {
"type": "string"
},
"description": "Tags used to select a subset of proxies by tags. Can only be used with kinds\n`MeshSubset` and `MeshServiceSubset`",
"type": "object"
}
},
"required": [
"kind"
],
"type": "object"
},
"to": {
"description": "To matches destination services of requests and holds configuration.",
"items": {
"properties": {
"hostnames": {
"description": "Hostnames is only valid when targeting MeshGateway and limits the\neffects of the rules to requests to this hostname.\nGiven hostnames must intersect with the hostname of the listeners the\nroute attaches to.",
"items": {
"type": "string"
},
"type": "array"
},
"rules": {
"description": "Rules contains the routing rules applies to a combination of top-level\ntargetRef and the targetRef in this entry.",
"items": {
"properties": {
"default": {
"description": "Default holds routing rules that can be merged with rules from other\npolicies.",
"properties": {
"backendRefs": {
"items": {
"description": "BackendRef defines where to forward traffic.",
"properties": {
"kind": {
"description": "Kind of the referenced resource",
"enum": [
"Mesh",
"MeshSubset",
"MeshGateway",
"MeshService",
"MeshExternalService",
"MeshMultiZoneService",
"MeshServiceSubset",
"MeshHTTPRoute",
"Dataplane"
],
"type": "string"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"description": "Labels are used to select group of MeshServices that match labels. Either Labels or\nName and Namespace can be used.",
"type": "object"
},
"mesh": {
"description": "Mesh is reserved for future use to identify cross mesh resources.",
"type": "string"
},
"name": {
"description": "Name of the referenced resource. Can only be used with kinds: `MeshService`,\n`MeshServiceSubset` and `MeshGatewayRoute`",
"type": "string"
},
"namespace": {
"description": "Namespace specifies the namespace of target resource. If empty only resources in policy namespace\nwill be targeted.",
"type": "string"
},
"port": {
"description": "Port is only supported when this ref refers to a real MeshService object",
"format": "int32",
"type": "integer"
},
"proxyTypes": {
"description": "ProxyTypes specifies the data plane types that are subject to the policy. When not specified,\nall data plane types are targeted by the policy.",
"items": {
"enum": [
"Sidecar",
"Gateway"
],
"type": "string"
},
"type": "array"
},
"sectionName": {
"description": "SectionName is used to target specific section of resource.\nFor example, you can target port from MeshService.ports[] by its name. Only traffic to this port will be affected.",
"type": "string"
},
"tags": {
"additionalProperties": {
"type": "string"
},
"description": "Tags used to select a subset of proxies by tags. Can only be used with kinds\n`MeshSubset` and `MeshServiceSubset`",
"type": "object"
},
"weight": {
"default": 1,
"minimum": 0,
"type": "integer"
}
},
"required": [
"kind"
],
"type": "object"
},
"type": "array"
},
"filters": {
"items": {
"properties": {
"requestHeaderModifier": {
"description": "Only one action is supported per header name.\nConfiguration to set or add multiple values for a header must use RFC 7230\nheader value formatting, separating each value with a comma.",
"properties": {
"add": {
"items": {
"properties": {
"name": {
"maxLength": 256,
"minLength": 1,
"pattern": "^[a-z0-9!#$%&'*+\\-.^_\\x60|~]+$",
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"maxItems": 16,
"type": "array",
"x-kubernetes-list-map-keys": [
"name"
],
"x-kubernetes-list-type": "map"
},
"remove": {
"items": {
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"set": {
"items": {
"properties": {
"name": {
"maxLength": 256,
"minLength": 1,
"pattern": "^[a-z0-9!#$%&'*+\\-.^_\\x60|~]+$",
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"maxItems": 16,
"type": "array",
"x-kubernetes-list-map-keys": [
"name"
],
"x-kubernetes-list-type": "map"
}
},
"type": "object"
},
"requestMirror": {
"properties": {
"backendRef": {
"description": "BackendRef defines where to forward traffic.",
"properties": {
"kind": {
"description": "Kind of the referenced resource",
"enum": [
"Mesh",
"MeshSubset",
"MeshGateway",
"MeshService",
"MeshExternalService",
"MeshMultiZoneService",
"MeshServiceSubset",
"MeshHTTPRoute",
"Dataplane"
],
"type": "string"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"description": "Labels are used to select group of MeshServices that match labels. Either Labels or\nName and Namespace can be used.",
"type": "object"
},
"mesh": {
"description": "Mesh is reserved for future use to identify cross mesh resources.",
"type": "string"
},
"name": {
"description": "Name of the referenced resource. Can only be used with kinds: `MeshService`,\n`MeshServiceSubset` and `MeshGatewayRoute`",
"type": "string"
},
"namespace": {
"description": "Namespace specifies the namespace of target resource. If empty only resources in policy namespace\nwill be targeted.",
"type": "string"
},
"port": {
"description": "Port is only supported when this ref refers to a real MeshService object",
"format": "int32",
"type": "integer"
},
"proxyTypes": {
"description": "ProxyTypes specifies the data plane types that are subject to the policy. When not specified,\nall data plane types are targeted by the policy.",
"items": {
"enum": [
"Sidecar",
"Gateway"
],
"type": "string"
},
"type": "array"
},
"sectionName": {
"description": "SectionName is used to target specific section of resource.\nFor example, you can target port from MeshService.ports[] by its name. Only traffic to this port will be affected.",
"type": "string"
},
"tags": {
"additionalProperties": {
"type": "string"
},
"description": "Tags used to select a subset of proxies by tags. Can only be used with kinds\n`MeshSubset` and `MeshServiceSubset`",
"type": "object"
},
"weight": {
"default": 1,
"minimum": 0,
"type": "integer"
}
},
"required": [
"kind"
],
"type": "object"
},
"percentage": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"description": "Percentage of requests to mirror. If not specified, all requests\nto the target cluster will be mirrored.",
"x-kubernetes-int-or-string": true
}
},
"required": [
"backendRef"
],
"type": "object"
},
"requestRedirect": {
"properties": {
"hostname": {
"description": "PreciseHostname is the fully qualified domain name of a network host. This\nmatches the RFC 1123 definition of a hostname with 1 notable exception that\nnumeric IP addresses are not allowed.\n\nNote that as per RFC1035 and RFC1123, a *label* must consist of lower case\nalphanumeric characters or '-', and must start and end with an alphanumeric\ncharacter. No other punctuation is allowed.",
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$",
"type": "string"
},
"path": {
"description": "Path defines parameters used to modify the path of the incoming request.\nThe modified path is then used to construct the location header.\nWhen empty, the request path is used as-is.",
"properties": {
"replaceFullPath": {
"type": "string"
},
"replacePrefixMatch": {
"type": "string"
},
"type": {
"enum": [
"ReplaceFullPath",
"ReplacePrefixMatch"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
"port": {
"description": "Port is the port to be used in the value of the `Location`\nheader in the response.\nWhen empty, port (if specified) of the request is used.",
"format": "int32",
"maximum": 65535,
"minimum": 1,
"type": "integer"
},
"scheme": {
"enum": [
"http",
"https"
],
"type": "string"
},
"statusCode": {
"default": 302,
"description": "StatusCode is the HTTP status code to be used in response.",
"enum": [
301,
302,
303,
307,
308
],
"type": "integer"
}
},
"type": "object"
},
"responseHeaderModifier": {
"description": "Only one action is supported per header name.\nConfiguration to set or add multiple values for a header must use RFC 7230\nheader value formatting, separating each value with a comma.",
"properties": {
"add": {
"items": {
"properties": {
"name": {
"maxLength": 256,
"minLength": 1,
"pattern": "^[a-z0-9!#$%&'*+\\-.^_\\x60|~]+$",
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"maxItems": 16,
"type": "array",
"x-kubernetes-list-map-keys": [
"name"
],
"x-kubernetes-list-type": "map"
},
"remove": {
"items": {
"type": "string"
},
"maxItems": 16,
"type": "array"
},
"set": {
"items": {
"properties": {
"name": {
"maxLength": 256,
"minLength": 1,
"pattern": "^[a-z0-9!#$%&'*+\\-.^_\\x60|~]+$",
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"maxItems": 16,
"type": "array",
"x-kubernetes-list-map-keys": [
"name"
],
"x-kubernetes-list-type": "map"
}
},
"type": "object"
},
"type": {
"enum": [
"RequestHeaderModifier",
"ResponseHeaderModifier",
"RequestRedirect",
"URLRewrite",
"RequestMirror"
],
"type": "string"
},
"urlRewrite": {
"properties": {
"hostToBackendHostname": {
"description": "HostToBackendHostname rewrites the hostname to the hostname of the\nupstream host. This option is only available when targeting MeshGateways.",
"type": "boolean"
},
"hostname": {
"description": "Hostname is the value to be used to replace the host header value during forwarding.",
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$",
"type": "string"
},
"path": {
"description": "Path defines a path rewrite.",
"properties": {
"replaceFullPath": {
"type": "string"
},
"replacePrefixMatch": {
"type": "string"
},
"type": {
"enum": [
"ReplaceFullPath",
"ReplacePrefixMatch"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
},
"type": "object"
}
},
"required": [
"type"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"matches": {
"description": "Matches describes how to match HTTP requests this rule should be applied\nto.",
"items": {
"properties": {
"headers": {
"items": {
"description": "HeaderMatch describes how to select an HTTP route by matching HTTP request\nheaders.",
"properties": {
"name": {
"description": "Name is the name of the HTTP Header to be matched. Name MUST be lower case\nas they will be handled with case insensitivity (See https://tools.ietf.org/html/rfc7230#section-3.2).",
"maxLength": 256,
"minLength": 1,
"pattern": "^[a-z0-9!#$%&'*+\\-.^_\\x60|~]+$",
"type": "string"
},
"type": {
"default": "Exact",
"description": "Type specifies how to match against the value of the header.",
"enum": [
"Exact",
"Present",
"RegularExpression",
"Absent",
"Prefix"
],
"type": "string"
},
"value": {
"description": "Value is the value of HTTP Header to be matched.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"type": "array"
},
"method": {
"enum": [
"CONNECT",
"DELETE",
"GET",
"HEAD",
"OPTIONS",
"PATCH",
"POST",
"PUT",
"TRACE"
],
"type": "string"
},
"path": {
"properties": {
"type": {
"enum": [
"Exact",
"PathPrefix",
"RegularExpression"
],
"type": "string"
},
"value": {
"description": "Exact or prefix matches must be an absolute path. A prefix matches only\nif separated by a slash or the entire path.",
"minLength": 1,
"type": "string"
}
},
"required": [
"type",
"value"
],
"type": "object"
},
"queryParams": {
"description": "QueryParams matches based on HTTP URL query parameters. Multiple matches\nare ANDed together such that all listed matches must succeed.",
"items": {
"properties": {
"name": {
"minLength": 1,
"type": "string"
},
"type": {
"enum": [
"Exact",
"RegularExpression"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"name",
"type",
"value"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"minItems": 1,
"type": "array"
}
},
"required": [
"default",
"matches"
],
"type": "object"
},
"type": "array"
},
"targetRef": {
"description": "TargetRef is a reference to the resource that represents a group of\nrequest destinations.",
"properties": {
"kind": {
"description": "Kind of the referenced resource",
"enum": [
"Mesh",
"MeshSubset",
"MeshGateway",
"MeshService",
"MeshExternalService",
"MeshMultiZoneService",
"MeshServiceSubset",
"MeshHTTPRoute",
"Dataplane"
],
"type": "string"
},
"labels": {
"additionalProperties": {
"type": "string"
},
"description": "Labels are used to select group of MeshServices that match labels. Either Labels or\nName and Namespace can be used.",
"type": "object"
},
"mesh": {
"description": "Mesh is reserved for future use to identify cross mesh resources.",
"type": "string"
},
"name": {
"description": "Name of the referenced resource. Can only be used with kinds: `MeshService`,\n`MeshServiceSubset` and `MeshGatewayRoute`",
"type": "string"
},
"namespace": {
"description": "Namespace specifies the namespace of target resource. If empty only resources in policy namespace\nwill be targeted.",
"type": "string"
},
"proxyTypes": {
"description": "ProxyTypes specifies the data plane types that are subject to the policy. When not specified,\nall data plane types are targeted by the policy.",
"items": {
"enum": [
"Sidecar",
"Gateway"
],
"type": "string"
},
"type": "array"
},
"sectionName": {
"description": "SectionName is used to target specific section of resource.\nFor example, you can target port from MeshService.ports[] by its name. Only traffic to this port will be affected.",
"type": "string"
},
"tags": {
"additionalProperties": {
"type": "string"
},
"description": "Tags used to select a subset of proxies by tags. Can only be used with kinds\n`MeshSubset` and `MeshServiceSubset`",
"type": "object"
}
},
"required": [
"kind"
],
"type": "object"
}
},
"required": [
"rules",
"targetRef"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
더 알아보기 (Learn more)
이 문서에는 원문에서 추출한 별도의 관련 문서 링크가 없어요.