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

MeshRateLimits 정책 구성 레퍼런스

원문 보기 위키 갱신

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

이 문서는 Kong Mesh의 MeshRateLimits 정책을 구성할 때 사용하는 필드들을 한눈에 확인할 수 있는 설정 참조 문서예요. MeshRateLimit 리소스의 스펙이 JSON 스키마 형태로 정의되어 있어서 각 필드가 어떤 역할을 하는지 자세히 살펴볼 수 있어요. 클라이언트 그룹별 기본 설정부터 로컬 HTTP·TCP 속도 제한, 속도 제한 이벤트 시 응답 헤더를 추가하거나 설정하는 옵션까지 다뤄요. 메시 안에서 서비스로 유입되는 트래픽 양을 제어하는 정책을 작성할 때 이 참조를 옆에 두고 보면 좋아요

출처: 문서

본문

구성

{
  "description": "Spec is the specification of the Kuma MeshRateLimit resource.",
  "properties": {
    "from": {
      "description": "From list makes a match between clients and corresponding configurations",
      "items": {
        "properties": {
          "default": {
            "description": "Default is a configuration specific to the group of clients referenced in\n'targetRef'",
            "properties": {
              "local": {
                "description": "LocalConf defines local http or/and tcp rate limit configuration",
                "properties": {
                  "http": {
                    "description": "LocalHTTP defines configuration of local HTTP rate limiting\nhttps://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/local_rate_limit_filter",
                    "properties": {
                      "disabled": {
                        "description": "Define if rate limiting should be disabled.",
                        "type": "boolean"
                      },
                      "onRateLimit": {
                        "description": "Describes the actions to take on a rate limit event",
                        "properties": {
                          "headers": {
                            "description": "The Headers to be added to the HTTP response on a rate limit event",
                            "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"
                              },
                              "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"
                          },
                          "status": {
                            "description": "The HTTP status code to be set on a rate limit event",
                            "format": "int32",
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      "requestRate": {
                        "description": "Defines how many requests are allowed per interval.",
                        "properties": {
                          "interval": {
                            "description": "The interval the number of units is accounted for.",
                            "type": "string"
                          },
                          "num": {
                            "description": "Number of units per interval (depending on usage it can be a number of requests,\nor a number of connections).",
                            "format": "int32",
                            "type": "integer"
                          }
                        },
                        "required": [
                          "interval",
                          "num"
                        ],
                        "type": "object"
                      }
                    },
                    "type": "object"
                  },
                  "tcp": {
                    "description": "LocalTCP defines confguration of local TCP rate limiting\nhttps://www.envoyproxy.io/docs/envoy/latest/configuration/listeners/network_filters/local_rate_limit_filter",
                    "properties": {
                      "connectionRate": {
                        "description": "Defines how many connections are allowed per interval.",
                        "properties": {
                          "interval": {
                            "description": "The interval the number of units is accounted for.",
                            "type": "string"
                          },
                          "num": {
                            "description": "Number of units per interval (depending on usage it can be a number of requests,\nor a number of connections).",
                            "format": "int32",
                            "type": "integer"
                          }
                        },
                        "required": [
                          "interval",
                          "num"
                        ],
                        "type": "object"
                      },
                      "disabled": {
                        "description": "Define if rate limiting should be disabled.\nDefault: false",
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "targetRef": {
            "description": "TargetRef is a reference to the resource that represents a group of\nclients.",
            "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"
    },
    "rules": {
      "description": "Rules defines inbound rate limiting configurations.",
      "items": {
        "properties": {
          "default": {
            "description": "Default contains configuration of the inbound rate limits",
            "properties": {
              "local": {
                "description": "LocalConf defines local http or/and tcp rate limit configuration",
                "properties": {
                  "http": {
                    "description": "LocalHTTP defines configuration of local HTTP rate limiting\nhttps://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/local_rate_limit_filter",
                    "properties": {
                      "disabled": {
                        "description": "Define if rate limiting should be disabled.",
                        "type": "boolean"
                      },
                      "onRateLimit": {
                        "description": "Describes the actions to take on a rate limit event",
                        "properties": {
                          "headers": {
                            "description": "The Headers to be added to the HTTP response on a rate limit event",
                            "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"
                              },
                              "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"
                          },
                          "status": {
                            "description": "The HTTP status code to be set on a rate limit event",
                            "format": "int32",
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      "requestRate": {
                        "description": "Defines how many requests are allowed per interval.",
                        "properties": {
                          "interval": {
                            "description": "The interval the number of units is accounted for.",
                            "type": "string"
                          },
                          "num": {
                            "description": "Number of units per interval (depending on usage it can be a number of requests,\nor a number of connections).",
                            "format": "int32",
                            "type": "integer"
                          }
                        },
                        "required": [
                          "interval",
                          "num"
                        ],
                        "type": "object"
                      }
                    },
                    "type": "object"
                  },
                  "tcp": {
                    "description": "LocalTCP defines confguration of local TCP rate limiting\nhttps://www.envoyproxy.io/docs/envoy/latest/configuration/listeners/network_filters/local_rate_limit_filter",
                    "properties": {
                      "connectionRate": {
                        "description": "Defines how many connections are allowed per interval.",
                        "properties": {
                          "interval": {
                            "description": "The interval the number of units is accounted for.",
                            "type": "string"
                          },
                          "num": {
                            "description": "Number of units per interval (depending on usage it can be a number of requests,\nor a number of connections).",
                            "format": "int32",
                            "type": "integer"
                          }
                        },
                        "required": [
                          "interval",
                          "num"
                        ],
                        "type": "object"
                      },
                      "disabled": {
                        "description": "Define if rate limiting should be disabled.\nDefault: false",
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "matches": {
            "description": "Matches define additional conditions for applying this rate limit rule.",
            "items": {
              "properties": {
                "sni": {
                  "description": "SNI defines a matcher configuration for matching by SNI value carried on the TLS connection",
                  "properties": {
                    "type": {
                      "description": "Type defines how to match traffic by SNI. Only `Exact` is supported.",
                      "enum": [
                        "Exact"
                      ],
                      "type": "string"
                    },
                    "value": {
                      "description": "Value is the SNI carried on the TLS connection that needs to match for the configuration to be applied",
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "value"
                  ],
                  "type": "object"
                },
                "spiffeID": {
                  "description": "SpiffeID defines a matcher configuration for SpiffeID matching",
                  "properties": {
                    "type": {
                      "description": "Type defines how to match incoming traffic by SpiffeID. `Exact` or `Prefix` are allowed.",
                      "enum": [
                        "Exact",
                        "Prefix"
                      ],
                      "type": "string"
                    },
                    "value": {
                      "description": "Value is SpiffeID of a client that needs to match for the configuration to be applied",
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "value"
                  ],
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "type": "array"
    },
    "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 clients and corresponding configurations",
      "items": {
        "properties": {
          "default": {
            "description": "Default is a configuration specific to the group of clients referenced in\n'targetRef'",
            "properties": {
              "local": {
                "description": "LocalConf defines local http or/and tcp rate limit configuration",
                "properties": {
                  "http": {
                    "description": "LocalHTTP defines configuration of local HTTP rate limiting\nhttps://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/local_rate_limit_filter",
                    "properties": {
                      "disabled": {
                        "description": "Define if rate limiting should be disabled.",
                        "type": "boolean"
                      },
                      "onRateLimit": {
                        "description": "Describes the actions to take on a rate limit event",
                        "properties": {
                          "headers": {
                            "description": "The Headers to be added to the HTTP response on a rate limit event",
                            "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"
                              },
                              "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"
                          },
                          "status": {
                            "description": "The HTTP status code to be set on a rate limit event",
                            "format": "int32",
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      "requestRate": {
                        "description": "Defines how many requests are allowed per interval.",
                        "properties": {
                          "interval": {
                            "description": "The interval the number of units is accounted for.",
                            "type": "string"
                          },
                          "num": {
                            "description": "Number of units per interval (depending on usage it can be a number of requests,\nor a number of connections).",
                            "format": "int32",
                            "type": "integer"
                          }
                        },
                        "required": [
                          "interval",
                          "num"
                        ],
                        "type": "object"
                      }
                    },
                    "type": "object"
                  },
                  "tcp": {
                    "description": "LocalTCP defines confguration of local TCP rate limiting\nhttps://www.envoyproxy.io/docs/envoy/latest/configuration/listeners/network_filters/local_rate_limit_filter",
                    "properties": {
                      "connectionRate": {
                        "description": "Defines how many connections are allowed per interval.",
                        "properties": {
                          "interval": {
                            "description": "The interval the number of units is accounted for.",
                            "type": "string"
                          },
                          "num": {
                            "description": "Number of units per interval (depending on usage it can be a number of requests,\nor a number of connections).",
                            "format": "int32",
                            "type": "integer"
                          }
                        },
                        "required": [
                          "interval",
                          "num"
                        ],
                        "type": "object"
                      },
                      "disabled": {
                        "description": "Define if rate limiting should be disabled.\nDefault: false",
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "targetRef": {
            "description": "TargetRef is a reference to the resource that represents a group of\nclients.",
            "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)

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