-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed config of envoy to a template, and added a start-envoy.sh scr…
…ipt that is run on initialization that creates the actual config file using the template and the env config variables Signed-off-by: Alfredo Gutierrez <[email protected]>
- Loading branch information
1 parent
dc87d2f
commit d0a1898
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
static_resources: | ||
listeners: | ||
- name: listener_0 | ||
address: | ||
socket_address: | ||
address: 0.0.0.0 | ||
port_value: ${PROXY_PORT} | ||
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: edge | ||
http_filters: | ||
- name: envoy.filters.http.lua | ||
typed_config: | ||
"@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua | ||
default_source_code: | ||
filename: /etc/envoy/filters/TokenVerificationFilter.lua | ||
|
||
- name: envoy.filters.http.router | ||
typed_config: | ||
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router | ||
route_config: | ||
virtual_hosts: | ||
- name: all_domains | ||
domains: ["*"] | ||
routes: | ||
- match: | ||
prefix: "/" | ||
headers: | ||
name: ":method" | ||
exact_match: "POST" | ||
route: | ||
cluster: upstream_service | ||
|
||
clusters: | ||
- name: upstream_service | ||
connect_timeout: 5s | ||
type: ${SERVICE_TYPE} | ||
load_assignment: | ||
cluster_name: upstream_service | ||
endpoints: | ||
- lb_endpoints: | ||
- endpoint: | ||
address: | ||
socket_address: | ||
address: ${SERVICE_ADDRESS} | ||
port_value: ${SERVICE_PORT} | ||
|
||
admin: | ||
address: | ||
socket_address: | ||
address: 0.0.0.0 | ||
port_value: ${ENVOY_ADMIN_PORT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
# Use envsubst to replace environment variables in the template | ||
envsubst < /etc/envoy/configs/envoy-auth-template.yaml > /etc/envoy/envoy-config.yaml | ||
# cat /etc/envoy/envoy-config.yaml | ||
cat /etc/envoy/envoy-config.yaml | ||
# Now start Envoy with the processed configuration | ||
envoy -c /etc/envoy/envoy-config.yaml |