Skip to content

Commit 854897f

Browse files
committed
doc: tmp use static envoy config in docker
Signed-off-by: hmoazzem <[email protected]>
1 parent 68cef4d commit 854897f

File tree

3 files changed

+109
-3
lines changed

3 files changed

+109
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ go install github.com/edgeflare/pgo@latest # or download from release page
9292
##### PostgREST-compatible REST API
9393

9494
```sh
95-
pgo rest --config internal/util/pgo/config.yaml --rest.pg_conn_string "host=localhost port=5432 user=pgo password=pgopw dbname=main sslmode=prefer"
95+
pgo rest --config internal/util/pgo/config.yaml
9696
```
9797

9898
###### realtime/replication eg sync users from auth-db to app-db

docker-compose.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,15 @@ services:
137137

138138
envoy:
139139
image: docker.io/envoyproxy/envoy:contrib-v1.33-latest
140-
command: [envoy, --config-path, /etc/bootstrap.yaml, --base-id, 1]
140+
# command: [envoy, --config-path, /etc/bootstrap.yaml, --base-id, 1] # when used with envoy-controlplane for dynamic config
141+
command: [envoy, --config-path, /etc/config.yaml, --base-id, 1]
141142
privileged: true
142143
ports:
143144
- 9901:9901 # admin
144145
- 80:10080 # http-proxy
145146
volumes:
146-
- $PWD/internal/util/envoy/bootstrap.yaml:/etc/bootstrap.yaml:rw,Z
147+
# - $PWD/internal/util/envoy/bootstrap.yaml:/etc/bootstrap.yaml:rw,Z # when used with envoy-controlplane
148+
- $PWD/internal/util/envoy/config.yaml:/etc/config.yaml:rw,Z # hard-coded config
147149
depends_on:
148150
- envoy-controlplane
149151

internal/util/envoy/config.yaml

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
admin:
2+
address:
3+
socket_address:
4+
address: 0.0.0.0
5+
port_value: 9901
6+
7+
static_resources:
8+
listeners:
9+
- name: listener_0
10+
address:
11+
socket_address:
12+
address: 0.0.0.0
13+
port_value: 10080
14+
filter_chains:
15+
- filters:
16+
- name: envoy.filters.network.http_connection_manager
17+
typed_config:
18+
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
19+
codec_type: auto
20+
stat_prefix: ingress_http
21+
route_config:
22+
name: multi_service_route
23+
virtual_hosts:
24+
- name: iam_service
25+
domains: ["iam.example.local", "zitadel.example.local"]
26+
routes:
27+
- match: { prefix: "/" }
28+
route:
29+
cluster: iam_zitadel_service
30+
timeout: 0s
31+
max_stream_duration:
32+
grpc_timeout_header_max: 0s
33+
cors:
34+
allow_origin_string_match:
35+
- prefix: "*"
36+
allow_methods: GET, PUT, DELETE, POST, OPTIONS
37+
allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,custom-header-1,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout
38+
max_age: "1728000"
39+
expose_headers: custom-header-1,grpc-status,grpc-message
40+
- name: pgo_service
41+
domains: ["api.example.local", "pgo.example.local"]
42+
routes:
43+
- match: { prefix: "/" }
44+
route:
45+
cluster: pgo_rest_service
46+
timeout: 0s
47+
max_stream_duration:
48+
grpc_timeout_header_max: 0s
49+
cors:
50+
allow_origin_string_match:
51+
- prefix: "*"
52+
allow_methods: GET, PUT, DELETE, POST, OPTIONS
53+
allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,custom-header-1,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout
54+
max_age: "1728000"
55+
expose_headers: custom-header-1,grpc-status,grpc-message
56+
http_filters:
57+
- name: envoy.filters.http.grpc_web
58+
typed_config:
59+
"@type": type.googleapis.com/envoy.extensions.filters.http.grpc_web.v3.GrpcWeb
60+
- name: envoy.filters.http.cors
61+
typed_config:
62+
"@type": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors
63+
- name: envoy.filters.http.router
64+
typed_config:
65+
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
66+
67+
clusters:
68+
- name: iam_zitadel_service
69+
connect_timeout: 0.25s
70+
type: LOGICAL_DNS
71+
typed_extension_protocol_options:
72+
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
73+
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
74+
explicit_http_config:
75+
http2_protocol_options: {}
76+
lb_policy: round_robin
77+
load_assignment:
78+
cluster_name: iam_zitadel_cluster
79+
endpoints:
80+
- lb_endpoints:
81+
- endpoint:
82+
address:
83+
socket_address:
84+
address: iam-zitadel
85+
port_value: 8080
86+
87+
- name: pgo_rest_service
88+
connect_timeout: 0.25s
89+
type: LOGICAL_DNS
90+
typed_extension_protocol_options:
91+
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
92+
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
93+
explicit_http_config:
94+
http2_protocol_options: {}
95+
lb_policy: round_robin
96+
load_assignment:
97+
cluster_name: pgo_rest_cluster
98+
endpoints:
99+
- lb_endpoints:
100+
- endpoint:
101+
address:
102+
socket_address:
103+
address: pgo-rest
104+
port_value: 8080

0 commit comments

Comments
 (0)