MeshLoadBalancingStrategies 정책 구성 참조
MeshLoadBalancingStrategies 정책 구성 참조 (MeshLoadBalancingStrategies Policy Configuration Reference)
이 문서는 Kong Mesh에서 MeshLoadBalancingStrategy 정책을 설정할 때 참고할 수 있는 구성 스펙을 정리한 참조 문서예요. targetRef처럼 반드시 지정해야 하는 필드와 정책이 적용될 대상 리소스의 종류, 라벨, 태그 같은 필드들이 JSON 스키마 형태로 설명되어 있어요. 각 필드가 어떤 역할을 하고 어떤 값을 사용할 수 있는지 그대로 확인하고 싶을 때 유용하게 쓸 수 있어요
출처: 문서
본문
구성
{
"description": "Spec is the specification of the Kuma MeshLoadBalancingStrategy 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 list makes a match between the consumed services and corresponding configurations",
"items": {
"properties": {
"default": {
"description": "Default is a configuration specific to the group of destinations referenced in\n'targetRef'",
"properties": {
"hashPolicies": {
"description": "HashPolicies specify a list of request/connection properties that are used to calculate a hash.\nThese hash policies are executed in the specified order. If a hash policy has the “terminal” attribute\nset to true, and there is already a hash generated, the hash is returned immediately,\nignoring the rest of the hash policy list.",
"items": {
"properties": {
"connection": {
"properties": {
"sourceIP": {
"description": "Hash on source IP address.",
"type": "boolean"
}
},
"type": "object"
},
"cookie": {
"properties": {
"name": {
"description": "The name of the cookie that will be used to obtain the hash key.",
"minLength": 1,
"type": "string"
},
"path": {
"description": "The name of the path for the cookie.",
"type": "string"
},
"ttl": {
"description": "If specified, a cookie with the TTL will be generated if the cookie is not present.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"filterState": {
"properties": {
"key": {
"description": "The name of the Object in the per-request filterState, which is\nan Envoy::Hashable object. If there is no data associated with the key,\nor the stored object is not Envoy::Hashable, no hash will be produced.",
"minLength": 1,
"type": "string"
}
},
"required": [
"key"
],
"type": "object"
},
"header": {
"properties": {
"name": {
"description": "The name of the request header that will be used to obtain the hash key.",
"minLength": 1,
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"queryParameter": {
"properties": {
"name": {
"description": "The name of the URL query parameter that will be used to obtain the hash key.\nIf the parameter is not present, no hash will be produced. Query parameter names\nare case-sensitive.",
"minLength": 1,
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"terminal": {
"description": "Terminal is a flag that short-circuits the hash computing. This field provides\na ‘fallback’ style of configuration: “if a terminal policy doesn’t work, fallback\nto rest of the policy list”, it saves time when the terminal policy works.\nIf true, and there is already a hash computed, ignore rest of the list of hash polices.",
"type": "boolean"
},
"type": {
"enum": [
"Header",
"Cookie",
"Connection",
"SourceIP",
"QueryParameter",
"FilterState"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
"type": "array"
},
"loadBalancer": {
"description": "LoadBalancer allows to specify load balancing algorithm.",
"properties": {
"leastRequest": {
"description": "LeastRequest selects N random available hosts as specified in 'choiceCount' (2 by default)\nand picks the host which has the fewest active requests",
"properties": {
"activeRequestBias": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"description": "ActiveRequestBias refers to dynamic weights applied when hosts have varying load\nbalancing weights. A higher value here aggressively reduces the weight of endpoints\nthat are currently handling active requests. In essence, the higher the ActiveRequestBias\nvalue, the more forcefully it reduces the load balancing weight of endpoints that are\nactively serving requests.",
"x-kubernetes-int-or-string": true
},
"choiceCount": {
"description": "ChoiceCount is the number of random healthy hosts from which the host with\nthe fewest active requests will be chosen. Defaults to 2 so that Envoy performs\ntwo-choice selection if the field is not set.",
"format": "int32",
"minimum": 2,
"type": "integer"
}
},
"type": "object"
},
"maglev": {
"description": "Maglev implements consistent hashing to upstream hosts. Maglev can be used as\na drop in replacement for the ring hash load balancer any place in which\nconsistent hashing is desired.",
"properties": {
"hashPolicies": {
"description": "HashPolicies specify a list of request/connection properties that are used to calculate a hash.\nThese hash policies are executed in the specified order. If a hash policy has the “terminal” attribute\nset to true, and there is already a hash generated, the hash is returned immediately,\nignoring the rest of the hash policy list.",
"items": {
"properties": {
"connection": {
"properties": {
"sourceIP": {
"description": "Hash on source IP address.",
"type": "boolean"
}
},
"type": "object"
},
"cookie": {
"properties": {
"name": {
"description": "The name of the cookie that will be used to obtain the hash key.",
"minLength": 1,
"type": "string"
},
"path": {
"description": "The name of the path for the cookie.",
"type": "string"
},
"ttl": {
"description": "If specified, a cookie with the TTL will be generated if the cookie is not present.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"filterState": {
"properties": {
"key": {
"description": "The name of the Object in the per-request filterState, which is\nan Envoy::Hashable object. If there is no data associated with the key,\nor the stored object is not Envoy::Hashable, no hash will be produced.",
"minLength": 1,
"type": "string"
}
},
"required": [
"key"
],
"type": "object"
},
"header": {
"properties": {
"name": {
"description": "The name of the request header that will be used to obtain the hash key.",
"minLength": 1,
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"queryParameter": {
"properties": {
"name": {
"description": "The name of the URL query parameter that will be used to obtain the hash key.\nIf the parameter is not present, no hash will be produced. Query parameter names\nare case-sensitive.",
"minLength": 1,
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"terminal": {
"description": "Terminal is a flag that short-circuits the hash computing. This field provides\na ‘fallback’ style of configuration: “if a terminal policy doesn’t work, fallback\nto rest of the policy list”, it saves time when the terminal policy works.\nIf true, and there is already a hash computed, ignore rest of the list of hash polices.",
"type": "boolean"
},
"type": {
"enum": [
"Header",
"Cookie",
"Connection",
"SourceIP",
"QueryParameter",
"FilterState"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
"type": "array"
},
"tableSize": {
"description": "The table size for Maglev hashing. Maglev aims for “minimal disruption”\nrather than an absolute guarantee. Minimal disruption means that when\nthe set of upstream hosts change, a connection will likely be sent\nto the same upstream as it was before. Increasing the table size reduces\nthe amount of disruption. The table size must be prime number limited to 5000011.\nIf it is not specified, the default is 65537.",
"format": "int32",
"maximum": 5000011,
"minimum": 1,
"type": "integer"
}
},
"type": "object"
},
"random": {
"description": "Random selects a random available host. The random load balancer generally\nperforms better than round-robin if no health checking policy is configured.\nRandom selection avoids bias towards the host in the set that comes after a failed host.",
"type": "object"
},
"ringHash": {
"description": "RingHash implements consistent hashing to upstream hosts. Each host is mapped\nonto a circle (the “ring”) by hashing its address; each request is then routed\nto a host by hashing some property of the request, and finding the nearest\ncorresponding host clockwise around the ring.",
"properties": {
"hashFunction": {
"description": "HashFunction is a function used to hash hosts onto the ketama ring.\nThe value defaults to XX_HASH. Available values – XX_HASH, MURMUR_HASH_2.",
"enum": [
"XXHash",
"MurmurHash2"
],
"type": "string"
},
"hashPolicies": {
"description": "HashPolicies specify a list of request/connection properties that are used to calculate a hash.\nThese hash policies are executed in the specified order. If a hash policy has the “terminal” attribute\nset to true, and there is already a hash generated, the hash is returned immediately,\nignoring the rest of the hash policy list.",
"items": {
"properties": {
"connection": {
"properties": {
"sourceIP": {
"description": "Hash on source IP address.",
"type": "boolean"
}
},
"type": "object"
},
"cookie": {
"properties": {
"name": {
"description": "The name of the cookie that will be used to obtain the hash key.",
"minLength": 1,
"type": "string"
},
"path": {
"description": "The name of the path for the cookie.",
"type": "string"
},
"ttl": {
"description": "If specified, a cookie with the TTL will be generated if the cookie is not present.",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"filterState": {
"properties": {
"key": {
"description": "The name of the Object in the per-request filterState, which is\nan Envoy::Hashable object. If there is no data associated with the key,\nor the stored object is not Envoy::Hashable, no hash will be produced.",
"minLength": 1,
"type": "string"
}
},
"required": [
"key"
],
"type": "object"
},
"header": {
"properties": {
"name": {
"description": "The name of the request header that will be used to obtain the hash key.",
"minLength": 1,
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"queryParameter": {
"properties": {
"name": {
"description": "The name of the URL query parameter that will be used to obtain the hash key.\nIf the parameter is not present, no hash will be produced. Query parameter names\nare case-sensitive.",
"minLength": 1,
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"terminal": {
"description": "Terminal is a flag that short-circuits the hash computing. This field provides\na ‘fallback’ style of configuration: “if a terminal policy doesn’t work, fallback\nto rest of the policy list”, it saves time when the terminal policy works.\nIf true, and there is already a hash computed, ignore rest of the list of hash polices.",
"type": "boolean"
},
"type": {
"enum": [
"Header",
"Cookie",
"Connection",
"SourceIP",
"QueryParameter",
"FilterState"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
"type": "array"
},
"maxRingSize": {
"description": "Maximum hash ring size. Defaults to 8M entries, and limited to 8M entries,\nbut can be lowered to further constrain resource use.",
"format": "int32",
"maximum": 8000000,
"minimum": 1,
"type": "integer"
},
"minRingSize": {
"description": "Minimum hash ring size. The larger the ring is (that is,\nthe more hashes there are for each provided host) the better the request distribution\nwill reflect the desired weights. Defaults to 1024 entries, and limited to 8M entries.",
"format": "int32",
"maximum": 8000000,
"minimum": 1,
"type": "integer"
}
},
"type": "object"
},
"roundRobin": {
"description": "RoundRobin is a load balancing algorithm that distributes requests\nacross available upstream hosts in round-robin order.",
"type": "object"
},
"type": {
"enum": [
"RoundRobin",
"LeastRequest",
"RingHash",
"Random",
"Maglev"
],
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
},
"localityAwareness": {
"description": "LocalityAwareness contains configuration for locality aware load balancing.",
"properties": {
"crossZone": {
"description": "CrossZone defines locality aware load balancing priorities when dataplane proxies inside local zone\nare unavailable",
"properties": {
"failover": {
"description": "Failover defines list of load balancing rules in order of priority",
"items": {
"properties": {
"from": {
"description": "From defines the list of zones to which the rule applies",
"properties": {
"zones": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"zones"
],
"type": "object"
},
"to": {
"description": "To defines to which zones the traffic should be load balanced",
"properties": {
"type": {
"description": "Type defines how target zones will be picked from available zones",
"enum": [
"None",
"Only",
"Any",
"AnyExcept"
],
"type": "string"
},
"zones": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"type"
],
"type": "object"
}
},
"required": [
"to"
],
"type": "object"
},
"type": "array"
},
"failoverThreshold": {
"description": "FailoverThreshold defines the percentage of live destination dataplane proxies below which load balancing to the\nnext priority starts.\nExample: If you configure failoverThreshold to 70, and you have deployed 10 destination dataplane proxies.\nLoad balancing to next priority will start when number of live destination dataplane proxies drops below 7.\nDefault 50",
"properties": {
"percentage": {
"anyOf": [
{
"type": "integer"
},
{
"type": "string"
}
],
"x-kubernetes-int-or-string": true
}
},
"required": [
"percentage"
],
"type": "object"
}
},
"type": "object"
},
"disabled": {
"description": "Disabled allows to disable locality-aware load balancing.\nWhen disabled requests are distributed across all endpoints regardless of locality.",
"type": "boolean"
},
"localZone": {
"description": "LocalZone defines locality aware load balancing priorities between dataplane proxies inside a zone",
"properties": {
"affinityTags": {
"description": "AffinityTags list of tags for local zone load balancing.",
"items": {
"properties": {
"key": {
"description": "Key defines tag for which affinity is configured",
"type": "string"
},
"weight": {
"description": "Weight of the tag used for load balancing. The bigger the weight the bigger the priority.\nPercentage of local traffic load balanced to tag is computed by dividing weight by sum of weights from all tags.\nFor example with two affinity tags first with weight 80 and second with weight 20,\nthen 80% of traffic will be redirected to the first tag, and 20% of traffic will be redirected to second one.\nSetting weights is not mandatory. When weights are not set control plane will compute default weight based on list order.\nDefault: If you do not specify weight we will adjust them so that 90% traffic goes to first tag, 9% to next, and 1% to third and so on.",
"format": "int32",
"type": "integer"
}
},
"required": [
"key"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
},
"targetRef": {
"description": "TargetRef is a reference to the resource that represents a group of\ndestinations.",
"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": [
"targetRef"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
더 알아보기 (Learn more)
이 문서에는 원문에서 추출한 별도의 관련 문서 링크가 없어요.