-
Notifications
You must be signed in to change notification settings - Fork 0
/
envoy.yaml.tmpl
145 lines (145 loc) · 5.74 KB
/
envoy.yaml.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
admin:
address:
socket_address:
address: 0.0.0.0
port_value: 9090
static_resources:
clusters:
- name: pimlico-api
connect_timeout: 2.0s
type: STRICT_DNS
dns_lookup_family: V4_ONLY
respect_dns_ttl: true
lb_policy: LEAST_REQUEST
load_assignment:
cluster_name: pimlico-api
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: &host api.pimlico.io
port_value: 443
transport_socket:
name: envoy.transport_sockets.tls
typed_config:
'@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext
sni: *host
- lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: opentelemetry_collector
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: ${OTEL_HOST}
port_value: 80
name: opentelemetry_collector
type: STRICT_DNS
- lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: admin
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 0.0.0.0
port_value: 9090
name: admin
type: STRICT_DNS
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
'@type': type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicit_http_config:
http2_protocol_options: {}
listeners:
- name: pimlico-api
address:
socket_address:
address: 0.0.0.0
port_value: 8080
per_connection_buffer_limit_bytes: 16777216
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: pimlico-api
stream_idle_timeout: 900s
access_log:
- name: envoy.access_loggers.file
typed_config:
'@type': type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
path: /dev/stdout
log_format:
json_format:
downstream_local_address: '%DOWNSTREAM_LOCAL_ADDRESS%'
method: '%REQ(:METHOD)%'
duration: '%DURATION%'
start_time: '%START_TIME(%Y-%m-%dT%H:%M:%S%z)%'
path: '%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%'
protocol: '%PROTOCOL%'
response_code: '%RESPONSE_CODE%'
route_name: '%ROUTE_NAME%'
traceparent: '%REQ(TRACEPARENT)%'
upstream_cluster: '%UPSTREAM_CLUSTER%'
upstream_host: '%UPSTREAM_HOST%'
upstream_request_attempt_count: '%UPSTREAM_REQUEST_ATTEMPT_COUNT%'
request_id: '%REQ(X-REQUEST-ID)%'
x_forwarded_for: '%REQ(X-FORWARDED-FOR)%'
user_agent: '%REQ(USER-AGENT)%'
http_filters:
- name: envoy.filters.http.router
typed_config:
'@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
tracing:
provider:
name: envoy.tracers.opentelemetry
typed_config:
'@type': type.googleapis.com/envoy.config.trace.v3.OpenTelemetryConfig
http_service:
http_uri:
timeout: 5s
uri: https://${OTEL_HOST}/otlp/v1/traces
cluster: opentelemetry_collector
request_headers_to_add:
- header:
key: 'Authorization'
value: ${OTEL_AUTH}
service_name: pimlico-proxy
route_config:
name: pimlico-api
virtual_hosts:
- name: pimlico-api
domains:
- '*'
include_attempt_count_in_response: true
request_headers_to_remove:
- x-forwarded-host
- x-forwarded-port
- x-forwarded-proto
- x-forwarded-server
response_headers_to_add:
- header:
key: x-request-id
value: '%REQ(X-REQUEST-ID)%'
append_action: OVERWRITE_IF_EXISTS_OR_ADD
routes:
- name: admin
match:
prefix: /admin
route:
auto_host_rewrite: true
prefix_rewrite: /
cluster: admin
timeout: 10s
- name: json-rpc
match:
prefix: /
route:
auto_host_rewrite: true
cluster: pimlico-api
timeout: 10s