본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

MeshRetries 정책 구성 레퍼런스

원문 보기 위키 갱신

MeshRetries 정책 구성 레퍼런스 (MeshRetries Policy Configuration Reference)

이 문서는 Kong Mesh의 MeshRetry 정책 리소스를 구성할 때 참고할 수 있는 설정 레퍼런스예요. MeshRetry 리소스의 전체 스키마를 JSON 형태로 보여주면서, targetRef로 정책이 적용될 대상을 지정하는 방법을 설명해요. Mesh, MeshService, MeshGateway 같은 다양한 kind와 라벨·태그 기반 선택 옵션까지 다루니까, 재시도 정책을 어떤 프록시나 서비스에 적용할지 세밀하게 조정할 때 유용해요

출처: 문서

본문

구성

{
  "description": "Spec is the specification of the Kuma MeshRetry 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": {
              "grpc": {
                "description": "GRPC defines a configuration of retries for GRPC traffic",
                "properties": {
                  "backOff": {
                    "description": "BackOff is a configuration of durations which will be used in an exponential\nbackoff strategy between retries.",
                    "properties": {
                      "baseInterval": {
                        "description": "BaseInterval is an amount of time which should be taken between retries.\nMust be greater than zero. Values less than 1 ms are rounded up to 1 ms.\nIf not specified then the default value is \"25ms\".",
                        "type": "string"
                      },
                      "maxInterval": {
                        "description": "MaxInterval is a maximal amount of time which will be taken between retries.\nDefault is 10 times the \"BaseInterval\".",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "numRetries": {
                    "description": "NumRetries is the number of attempts that will be made on failed (and\nretriable) requests. If not set, the default value is 1.",
                    "format": "int32",
                    "type": "integer"
                  },
                  "perTryTimeout": {
                    "description": "PerTryTimeout is the maximum amount of time each retry attempt can take\nbefore it times out. If not set, the global request timeout for the route\nwill be used. Setting this value to 0 will disable the per-try timeout.",
                    "type": "string"
                  },
                  "rateLimitedBackOff": {
                    "description": "RateLimitedBackOff is a configuration of backoff which will be used when\nthe upstream returns one of the headers configured.",
                    "properties": {
                      "maxInterval": {
                        "description": "MaxInterval is a maximal amount of time which will be taken between retries.\nIf not specified then the default value is \"300s\".",
                        "type": "string"
                      },
                      "resetHeaders": {
                        "description": "ResetHeaders specifies the list of headers (like Retry-After or X-RateLimit-Reset)\nto match against the response. Headers are tried in order, and matched\ncase-insensitive. The first header to be parsed successfully is used.\nIf no headers match the default exponential BackOff is used instead.",
                        "items": {
                          "properties": {
                            "format": {
                              "description": "The format of the reset header.",
                              "enum": [
                                "Seconds",
                                "UnixTimestamp"
                              ],
                              "type": "string"
                            },
                            "name": {
                              "description": "The Name of the reset header.",
                              "maxLength": 256,
                              "minLength": 1,
                              "pattern": "^[a-z0-9!#$%&'*+\\-.^_\\x60|~]+$",
                              "type": "string"
                            }
                          },
                          "required": [
                            "format",
                            "name"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      }
                    },
                    "type": "object"
                  },
                  "retryOn": {
                    "description": "RetryOn is a list of conditions which will cause a retry.",
                    "example": [
                      "Canceled",
                      "DeadlineExceeded",
                      "Internal",
                      "ResourceExhausted",
                      "Unavailable"
                    ],
                    "items": {
                      "enum": [
                        "Canceled",
                        "DeadlineExceeded",
                        "Internal",
                        "ResourceExhausted",
                        "Unavailable"
                      ],
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              },
              "http": {
                "description": "HTTP defines a configuration of retries for HTTP traffic",
                "properties": {
                  "backOff": {
                    "description": "BackOff is a configuration of durations which will be used in exponential\nbackoff strategy between retries.",
                    "properties": {
                      "baseInterval": {
                        "description": "BaseInterval is an amount of time which should be taken between retries.\nMust be greater than zero. Values less than 1 ms are rounded up to 1 ms.\nIf not specified then the default value is \"25ms\".",
                        "type": "string"
                      },
                      "maxInterval": {
                        "description": "MaxInterval is a maximal amount of time which will be taken between retries.\nDefault is 10 times the \"BaseInterval\".",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "hostSelection": {
                    "description": "HostSelection is a list of predicates that dictate how hosts should be selected\nwhen requests are retried.",
                    "items": {
                      "properties": {
                        "predicate": {
                          "description": "Type is requested predicate mode.",
                          "enum": [
                            "OmitPreviousHosts",
                            "OmitHostsWithTags",
                            "OmitPreviousPriorities"
                          ],
                          "type": "string"
                        },
                        "tags": {
                          "additionalProperties": {
                            "type": "string"
                          },
                          "description": "Tags is a map of metadata to match against for selecting the omitted hosts. Required if Type is\nOmitHostsWithTags",
                          "type": "object"
                        },
                        "updateFrequency": {
                          "default": 2,
                          "description": "UpdateFrequency is how often the priority load should be updated based on previously attempted priorities.\nUsed for OmitPreviousPriorities.",
                          "format": "int32",
                          "type": "integer"
                        }
                      },
                      "required": [
                        "predicate"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "hostSelectionMaxAttempts": {
                    "description": "HostSelectionMaxAttempts is the maximum number of times host selection will be\nreattempted before giving up, at which point the host that was last selected will\nbe routed to. If unspecified, this will default to retrying once.",
                    "format": "int64",
                    "type": "integer"
                  },
                  "numRetries": {
                    "description": "NumRetries is the number of attempts that will be made on failed (and\nretriable) requests.  If not set, the default value is 1.",
                    "format": "int32",
                    "type": "integer"
                  },
                  "perTryTimeout": {
                    "description": "PerTryTimeout is the amount of time after which retry attempt should time out.\nIf left unspecified, the global route timeout for the request will be used.\nConsequently, when using a 5xx based retry policy, a request that times out\nwill not be retried as the total timeout budget would have been exhausted.\nSetting this timeout to 0 will disable it.",
                    "type": "string"
                  },
                  "rateLimitedBackOff": {
                    "description": "RateLimitedBackOff is a configuration of backoff which will be used\nwhen the upstream returns one of the headers configured.",
                    "properties": {
                      "maxInterval": {
                        "description": "MaxInterval is a maximal amount of time which will be taken between retries.\nIf not specified then the default value is \"300s\".",
                        "type": "string"
                      },
                      "resetHeaders": {
                        "description": "ResetHeaders specifies the list of headers (like Retry-After or X-RateLimit-Reset)\nto match against the response. Headers are tried in order, and matched\ncase-insensitive. The first header to be parsed successfully is used.\nIf no headers match the default exponential BackOff is used instead.",
                        "items": {
                          "properties": {
                            "format": {
                              "description": "The format of the reset header.",
                              "enum": [
                                "Seconds",
                                "UnixTimestamp"
                              ],
                              "type": "string"
                            },
                            "name": {
                              "description": "The Name of the reset header.",
                              "maxLength": 256,
                              "minLength": 1,
                              "pattern": "^[a-z0-9!#$%&'*+\\-.^_\\x60|~]+$",
                              "type": "string"
                            }
                          },
                          "required": [
                            "format",
                            "name"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      }
                    },
                    "type": "object"
                  },
                  "retriableRequestHeaders": {
                    "description": "RetriableRequestHeaders is an HTTP headers which must be present in the request\nfor retries to be attempted.",
                    "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"
                  },
                  "retriableResponseHeaders": {
                    "description": "RetriableResponseHeaders is an HTTP response headers that trigger a retry\nif present in the response. A retry will be triggered if any of the header\nmatches the upstream response 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"
                  },
                  "retryOn": {
                    "description": "RetryOn is a list of conditions which will cause a retry. Available values are:\n[5XX, GatewayError, Reset, Retriable4xx, ConnectFailure, EnvoyRatelimited,\nRefusedStream, Http3PostConnectFailure, HttpMethodConnect, HttpMethodDelete,\nHttpMethodGet, HttpMethodHead, HttpMethodOptions, HttpMethodPatch,\nHttpMethodPost, HttpMethodPut, HttpMethodTrace].\nAlso, any HTTP status code (500, 503, etc.).",
                    "example": [
                      "5XX",
                      "GatewayError",
                      "Reset",
                      "Retriable4xx",
                      "ConnectFailure",
                      "EnvoyRatelimited",
                      "RefusedStream",
                      "Http3PostConnectFailure",
                      "HttpMethodConnect",
                      "HttpMethodDelete",
                      "HttpMethodGet",
                      "HttpMethodHead",
                      "HttpMethodOptions",
                      "HttpMethodPatch",
                      "HttpMethodPost",
                      "HttpMethodPut",
                      "HttpMethodTrace",
                      "500",
                      "503"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              },
              "tcp": {
                "description": "TCP defines a configuration of retries for TCP traffic",
                "properties": {
                  "maxConnectAttempt": {
                    "description": "MaxConnectAttempt is a maximal amount of TCP connection attempts\nwhich will be made before giving up",
                    "format": "int32",
                    "type": "integer"
                  }
                },
                "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)

이 문서에는 원문에서 추출한 별도의 관련 문서 링크가 없어요.