Commit e3dd49a2 authored by SHEFFALI JAIN's avatar SHEFFALI JAIN
Browse files

adding rate limit yamls

parent bb7fe106
Pipeline #92656 failed with stages
in 6 seconds
......@@ -12,3 +12,13 @@ image:
repository: #{container-registry}#.azurecr.io
branch: #{ENVIRONMENT_NAME}#
tag: #{Build.SourceVersion}#
################################################################################
# Specify the Rate limit Settings
#
envoyFilter:
enabled: false
rateLimit:
max_tokens: 100
tokens_per_fill: 100
fill_interval: 60
\ No newline at end of file
# Copyright © Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{ if .Values.envoyFilter.enabled }}
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: {{ .Release.Name }}-ratelimit
namespace: osdu
spec:
workloadSelector:
labels:
app: {{ .Release.Name }}
configPatches:
- applyTo: HTTP_FILTER
match:
context: SIDECAR_INBOUND # will match outbound listeners in all sidecars
listener:
filterChain:
filter:
name: envoy.http_connection_manager
patch:
operation: INSERT_BEFORE
value:
name: envoy.filters.http.local_ratelimit
typed_config:
"@type": type.googleapis.com/udpa.type.v1.TypedStruct
type_url: type.googleapis.com/envoy.extensions.filters.http.local_ratelimit.v3.LocalRateLimit
value:
stat_prefix: http_local_rate_limiter
token_bucket:
max_tokens: {{ .Values.envoyFilter.rateLimit.max_tokens }} #The maximum tokens that the bucket can hold.
tokens_per_fill: {{ .Values.envoyFilter.rateLimit.tokens_per_fill }} #The number of tokens added to the bucket during each fill interval.
fill_interval: {{ .Values.envoyFilter.rateLimit.fill_interval }} #The fill interval that tokens are added to the bucket in seconds.
filter_enabled:
runtime_key: local_rate_limit_enabled
default_value:
numerator: 100
denominator: HUNDRED
filter_enforced:
runtime_key: local_rate_limit_enforced
default_value:
numerator: 100
denominator: HUNDRED
response_headers_to_add:
- append: true
header:
key: x-local-rate-limit
value: 'true'
{{ end }}
\ No newline at end of file
......@@ -19,3 +19,13 @@ image:
repository: community.opengroup.org:5555/osdu/platform/system/dataset
branch: master
tag: latest
################################################################################
# Specify the Rate limit Settings
#
envoyFilter:
enabled: false
rateLimit:
max_tokens: 100
tokens_per_fill: 100
fill_interval: 60
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment