# Envoy configuration without tls for development and testing.
# Do not use this configuration in production. Please check the docs for examples using tls.
static_resources:
listeners:
- name: listener_http
address:
socket_address: { address: 0.0.0.0, port_value: 8449 }
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
codec_type: auto
stat_prefix: ingress_http
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains: ["*"]
routes:
- match:
prefix: "/api"
route:
cluster: apiserver-cluster-http
timeout: 0s
- match:
prefix: "/fonoster.identity.v1beta2.Identity/SendVerificationCode"
headers:
- name: "content-type"
safe_regex_match:
google_re2: {}
regex: "^(application/grpc|application/grpc-web-text)$"
route:
cluster: apiserver-cluster
timeout: 0s
max_stream_duration:
grpc_timeout_header_max: 0s
typed_per_filter_config:
envoy.filters.http.local_ratelimit:
"@type": type.googleapis.com/envoy.extensions.filters.http.local_ratelimit.v3.LocalRateLimit
stat_prefix: sms_verification_rate_limit
token_bucket:
max_tokens: 1
tokens_per_fill: 1
fill_interval: 60s
filter_enabled:
default_value:
numerator: 100
denominator: HUNDRED
filter_enforced:
default_value:
numerator: 100
denominator: HUNDRED
response_headers_to_add:
- append_action: OVERWRITE_IF_EXISTS_OR_ADD
header:
key: x-ratelimit-limit
value: "1 per 60s"
- match:
prefix: "/"
headers:
- name: "content-type"
safe_regex_match:
google_re2: {}
regex: "^(application/grpc|application/grpc-web-text)$"
route:
cluster: apiserver-cluster
timeout: 0s
max_stream_duration:
grpc_timeout_header_max: 0s
- match:
prefix: "/"
route:
cluster: dashboard-cluster
timeout: 0s
cors:
allow_origin_string_match:
- prefix: "*"
allow_methods: GET, PUT, DELETE, POST, OPTIONS
allow_headers: token,accesskeyid,keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout
max_age: "1728000"
expose_headers: grpc-status,grpc-message
http_filters:
- name: envoy.filters.http.grpc_web
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.grpc_web.v3.GrpcWeb
- name: envoy.filters.http.cors
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors
- name: envoy.filters.http.local_ratelimit
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.local_ratelimit.v3.LocalRateLimit
stat_prefix: general_api_rate_limit
token_bucket:
max_tokens: 100
tokens_per_fill: 100
fill_interval: 60s
filter_enabled:
default_value:
numerator: 100
denominator: HUNDRED
filter_enforced:
default_value:
numerator: 100
denominator: HUNDRED
response_headers_to_add:
- append_action: OVERWRITE_IF_EXISTS_OR_ADD
header:
key: x-ratelimit-limit
value: "100"
- append_action: OVERWRITE_IF_EXISTS_OR_ADD
header:
key: x-ratelimit-remaining
value: "%DYNAMIC_METADATA(envoy.filters.http.local_ratelimit:tokens_remaining)%"
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- name: apiserver-cluster
type: logical_dns
connect_timeout: 20s
http2_protocol_options: {}
lb_policy: round_robin
load_assignment:
cluster_name: apiserver-cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: apiserver
port_value: 50051
- name: apiserver-cluster-http
type: logical_dns
connect_timeout: 20s
lb_policy: round_robin
load_assignment:
cluster_name: apiserver-cluster-http
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: apiserver
port_value: 9876
- name: dashboard-cluster
type: logical_dns
connect_timeout: 20s
lb_policy: round_robin
load_assignment:
cluster_name: dashboard-cluster
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: dashboard
port_value: 3030