-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
190 lines (182 loc) · 6.96 KB
/
docker-compose.yaml
File metadata and controls
190 lines (182 loc) · 6.96 KB
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
version: '3.8'
services:
flagd:
image: ${IMAGE:-ghcr.io/open-feature/flagd-testbed}:${VERSION:-v3.6.1} # x-release-please-version
ports:
- 8013
- 8014
- 8015
- 8016
- 8080
volumes:
- ${FLAGS_DIR:-./}:/flags
networks:
- flagd-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8014/healthz"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
envoy:
image: envoyproxy/envoy:v1.35-latest
ports:
- 9211
- 9212
- 9901
command:
- /bin/sh
- -c
- |
echo "Creating envoy config..."
cat > /tmp/envoy.yaml << 'EOF'
admin:
address:
socket_address:
address: 0.0.0.0
port_value: 9901
static_resources:
listeners:
- name: local-envoy
address:
socket_address:
address: 0.0.0.0
port_value: 9211
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
stat_prefix: ingress_http
access_log:
- name: envoy.access_loggers.stdout
typed_config:
"@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
route_config:
name: local_route
virtual_hosts:
# Route for sync service
- name: sync-service
domains:
- "flagd-sync.service"
- "sync.flagd.local"
- "sync.service"
routes:
- match:
prefix: "/"
grpc: {}
route:
cluster: local-sync-service
# Route for RPC service
- name: rpc-service
domains:
- "flagd-rpc.service"
- "rpc.flagd.local"
- "rpc.service"
routes:
- match:
prefix: "/"
grpc: {}
route:
cluster: local-rpc-service
# Default catch-all
- name: default-service
domains:
- "*"
routes:
- match:
prefix: "/"
grpc: {}
route:
cluster: local-rpc-service
- name: permission-denied-listener
address:
socket_address:
address: 0.0.0.0
port_value: 9212
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
stat_prefix: permission_denied
access_log:
- name: envoy.access_loggers.stdout
typed_config:
"@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
route_config:
name: permission_denied_route
virtual_hosts:
- name: permission-denied
domains:
- "*"
routes:
- match:
prefix: "/"
grpc: {}
direct_response:
status: 403
body:
inline_string: "PERMISSION_DENIED"
clusters:
- name: local-sync-service
type: LOGICAL_DNS
dns_lookup_family: V4_ONLY
connect_timeout: 0.25s
http2_protocol_options: {}
health_checks:
- timeout: 1s
interval: 1s
unhealthy_threshold: 1
healthy_threshold: 1
tcp_health_check: {}
load_assignment:
cluster_name: local-sync-service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: flagd
port_value: 8015
- name: local-rpc-service
type: LOGICAL_DNS
dns_lookup_family: V4_ONLY
connect_timeout: 0.25s
http2_protocol_options: {}
health_checks:
- timeout: 1s
interval: 1s
unhealthy_threshold: 1
healthy_threshold: 1
tcp_health_check: {}
load_assignment:
cluster_name: local-rpc-service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: flagd
port_value: 8013
EOF
echo "Generated config:"
cat /tmp/envoy.yaml
echo "Starting envoy..."
exec envoy -c /tmp/envoy.yaml --log-level debug
depends_on:
flagd:
condition: service_healthy
networks:
- flagd-network
networks:
flagd-network:
driver: bridge