-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenvoy.yaml
executable file
·162 lines (157 loc) · 5.09 KB
/
envoy.yaml
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
admin:
access_log_path: /tmp/admin_access.log
address:
socket_address:
protocol: TCP
address: 127.0.0.1
port_value: 9901
static_resources:
listeners:
- name: listener_0
address:
socket_address:
protocol: TCP
address: 0.0.0.0
port_value: 10000
filter_chains:
- filters:
- name: envoy.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager
stat_prefix: ingress_http
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains: ["*"]
routes:
- match:
prefix: "/"
route:
host_rewrite: www.google.com
cluster: service_google
access_log:
name: envoy.file_access_log
typed_config:
"@type": type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
path: /dev/stdout
json_format:
protocol: "%PROTOCOL%"
cluster: "%UPSTREAM_CLUSTER%"
startTime: "%START_TIME%"
duration: "%RESPONSE_TX_DURATION%"
response_code: "%RESPONSE_CODE%"
upstream_serviceTime: "%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%"
upstream_host: "%UPSTREAM_HOST%"
path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%"
bytes_received: "%BYTES_RECEIVED%"
request_duration: "%REQUEST_DURATION%"
http_filters:
# - name: envoy.grpc_web
- name: envoy.ext_authz
typed_config:
"@type": type.googleapis.com/envoy.config.filter.http.ext_authz.v2.ExtAuthz
grpc_service:
envoy_grpc:
cluster_name: ext-authz
# Default is 200ms; override if your server needs e.g. warmup time.
timeout: 10s
# include_peer_certificate: false
- name: envoy.filters.http.lua
typed_config:
"@type": type.googleapis.com/envoy.config.filter.http.lua.v2.Lua
inline_code: |
function envoy_on_response(response_handle)
body_size = response_handle:body():length()
response_handle:headers():add("response-body-size", tostring(body_size))
response_handle:headers():add("upstream_foo", "foo")
end
- name: envoy.filters.http.tap
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.tap.v3.Tap
common_config:
static_config:
match_config:
http_response_headers_match:
headers:
- name: upstream_foo
exact_match: foo
output_config:
# streaming: true
sinks:
- format: JSON_BODY_AS_STRING
file_per_tap:
path_prefix: /taps/any
- name: envoy.cors
typed_config: {}
- name: envoy.router
config: {}
clusters:
- name: service_google
connect_timeout: 0.25s
type: LOGICAL_DNS
# Comment out the following line to test on v6 networks
dns_lookup_family: V4_ONLY
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: service_google
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: www.google.com
port_value: 443
transport_socket:
name: envoy.transport_sockets.tls
typed_config:
"@type": type.googleapis.com/envoy.api.v2.auth.UpstreamTlsContext
sni: www.google.com
- name: ext-authz
type: static
http2_protocol_options: {}
load_assignment:
cluster_name: ext-authz
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 172.17.0.1
port_value: 8081
# This timeout controls the initial TCP handshake timeout - not the timeout for the
# entire request.
connect_timeout: 0.25s
- name: analytics
connect_timeout: 1s
type: static
lb_policy: round_robin
load_assignment:
cluster_name: analytics
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 172.17.0.1
port_value: 9806
stats_sinks:
name: envoy.stat_sinks.statsd
config:
address:
socket_address:
address: 127.0.0.1
port_value: 8125
# - name: zipkin
# connect_timeout: 1s
# type: strict_dns
# lb_policy: round_robin
# load_assignment:
# cluster_name: zipkin
# endpoints:
# - lb_endpoints:
# - endpoint:
# address:
# socket_address:
# address: 172.17.0.1
# port_value: 9411