-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathenvoy.yaml
133 lines (133 loc) · 4.35 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
admin:
access_log_path: /dev/stdout
address:
socket_address:
protocol: TCP
address: 0.0.0.0
port_value: 9901
static_resources:
listeners:
- name: ingress_listener
address:
socket_address:
protocol: TCP
address: 0.0.0.0
port_value: 8080
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
codec_type: auto
stat_prefix: ingress
route_config:
name: local_route
virtual_hosts:
- name: ingress
domains: ["*"]
routes:
- match:
prefix: "/"
headers:
- name: x-emissary-auth
present_match: true
route:
cluster: app_container
##### if we dont have a x-emissary-auth header skip
##### auth to avoid blocking services that are not
##### emissary enabled
- match:
prefix: "/"
per_filter_config:
envoy.ext_authz:
disabled: true
route:
cluster: app_container
http_filters:
- name: envoy.ext_authz
config:
http_service:
server_uri:
uri: ext-authz
cluster: ext-authz
timeout: 1s
authorization_request:
headers_to_add:
- key: x-emissary-mode
value: "ingress"
allowed_headers:
patterns:
- exact: x-emissary-auth
authorization_response:
allowed_upstream_headers:
patterns:
- exact: x-emissary-auth-status
allowed_client_headers:
patterns:
- exact: x-emissary-auth-status
- name: envoy.router
- name: egress_listener
address:
socket_address:
protocol: TCP
address: 0.0.0.0
port_value: 18000
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
codec_type: auto
stat_prefix: egress
route_config:
name: local_route
virtual_hosts:
- name: egress
domains: ["*"]
routes:
- match:
prefix: "/"
route:
cluster: app_container
http_filters:
- name: envoy.ext_authz
config:
http_service:
server_uri:
uri: ext-authz
cluster: ext-authz
timeout: 1s
authorization_request:
headers_to_add:
- key: x-emissary-mode
value: "egress"
authorization_response:
allowed_upstream_headers:
patterns:
- exact: x-emissary-auth
- name: envoy.router
clusters:
- name: app_container
connect_timeout: 2s
type: strict_dns
lb_policy: round_robin
load_assignment:
cluster_name: app_container
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: app_container
port_value: 8000
- name: ext-authz
connect_timeout: 2s
type: strict_dns
lb_policy: round_robin
load_assignment:
cluster_name: emissary
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: emissary
port_value: 9090