istio.io/istio@v0.0.0-20240520182934-d79c90f27776/tests/integration/telemetry/policy/testdata/enable_envoy_local_ratelimit_per_route.yaml (about)

     1  apiVersion: networking.istio.io/v1alpha3
     2  kind: EnvoyFilter
     3  metadata:
     4    name: filter-local-ratelimit-svc
     5    namespace: istio-system
     6  spec:
     7    workloadSelector:
     8      labels:
     9        app: clt
    10    configPatches:
    11      - applyTo: HTTP_FILTER
    12        patch:
    13          operation: INSERT_BEFORE
    14          value:
    15            name: envoy.filters.http.local_ratelimit
    16            typed_config:
    17              "@type": type.googleapis.com/udpa.type.v1.TypedStruct
    18              type_url: type.googleapis.com/envoy.extensions.filters.http.local_ratelimit.v3.LocalRateLimit
    19              value:
    20                stat_prefix: http_local_rate_limiter
    21      - applyTo: HTTP_ROUTE
    22        match:
    23          context: SIDECAR_OUTBOUND
    24          routeConfiguration:
    25            vhost:
    26              name: "srv.{{ .EchoNamespace }}.svc.cluster.local:80"
    27              route:
    28                action: ANY
    29        patch:
    30          operation: MERGE
    31          value:
    32            typed_per_filter_config:
    33              envoy.filters.http.local_ratelimit:
    34                "@type": type.googleapis.com/udpa.type.v1.TypedStruct
    35                type_url: type.googleapis.com/envoy.extensions.filters.http.local_ratelimit.v3.LocalRateLimit
    36                value:
    37                  stat_prefix: http_local_rate_limiter
    38                  token_bucket:
    39                    max_tokens: 1
    40                    tokens_per_fill: 1
    41                    fill_interval: 600s
    42                  filter_enabled:
    43                    runtime_key: local_rate_limit_enabled
    44                    default_value:
    45                      numerator: 100
    46                      denominator: HUNDRED
    47                  filter_enforced:
    48                    runtime_key: local_rate_limit_enforced
    49                    default_value:
    50                      numerator: 100
    51                      denominator: HUNDRED
    52                  response_headers_to_add:
    53                    - append: false
    54                      header:
    55                        key: x-local-rate-limit
    56                        value: 'true'