-
Notifications
You must be signed in to change notification settings - Fork 42
Install and configure Envoy #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
sjmiller609
wants to merge
31
commits into
main
Choose a base branch
from
embed-envoy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 6 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
ff9769d
Install envoy and configs
sjmiller609 1ca9fb3
Configure chrome to use proxy for tests
sjmiller609 fd5411e
Fix default copied location
sjmiller609 8b71927
Only test headful
sjmiller609 23e9162
delete unneeded copy
sjmiller609 cd6eaf9
Fix executable name
sjmiller609 fde7806
Configure tls + jwt auth
sjmiller609 4caaa98
Fix port
sjmiller609 2bdad13
Add docs
sjmiller609 91c83fd
Fix logging jwt
sjmiller609 159ef5d
Fix template render
sjmiller609 e63734a
make list
sjmiller609 864fdc3
Envoy log level warning
sjmiller609 aa1050e
Fix indentation
sjmiller609 3361f83
Fix bootstrap config
sjmiller609 4184afb
Simplify log level
sjmiller609 80834d5
Fix cluster name
sjmiller609 0a6dd7f
Configure authority header
sjmiller609 61b051a
fix indentation
sjmiller609 7a225e2
Configuration working for both proxied and direct
sjmiller609 4c42976
install brightdata certs
sjmiller609 a5a80fb
Add certificates in headless image
sjmiller609 dee45a2
Fixes from code review
sjmiller609 38ddb1e
Don't start with envoy if not set up
sjmiller609 c64c387
Update server/e2e/e2e_chromium_test.go
sjmiller609 2ab855d
Set log level to warn
sjmiller609 941be66
Disable admin interface
sjmiller609 d7782cd
Less logs when doesn't start
sjmiller609 0eba893
Update images/chromium-headful/Dockerfile
sjmiller609 01d7303
Update shared/envoy/init-envoy.sh
sjmiller609 bd89af1
Log when we connected to the port
sjmiller609 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,40 @@ | ||
| node: | ||
| id: "{INSTANCE_NAME}-{METRO_NAME}" | ||
|
|
||
| dynamic_resources: | ||
| ads_config: | ||
| api_type: GRPC | ||
| transport_api_version: V3 | ||
| grpc_services: | ||
| - envoy_grpc: | ||
| cluster_name: xds_server | ||
| lds_config: | ||
| ads: {} | ||
| resource_api_version: V3 | ||
| cds_config: | ||
| ads: {} | ||
| resource_api_version: V3 | ||
|
|
||
| static_resources: | ||
| clusters: | ||
| - name: xds_server | ||
| type: STRICT_DNS | ||
| connect_timeout: 2s | ||
| http2_protocol_options: {} | ||
| load_assignment: | ||
| cluster_name: xds_server | ||
| endpoints: | ||
| - lb_endpoints: | ||
| - endpoint: | ||
| address: | ||
| socket_address: | ||
| address: control-plane | ||
| port_value: 18000 | ||
|
|
||
| admin: | ||
| address: | ||
| socket_address: | ||
| address: 127.0.0.1 | ||
| port_value: 9901 | ||
|
|
||
|
|
This file contains hidden or 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,71 @@ | ||
| static_resources: | ||
| listeners: | ||
| - name: http_explicit_forward_proxy | ||
| address: | ||
| socket_address: | ||
| address: 0.0.0.0 | ||
| port_value: 3128 | ||
| 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: hcm | ||
| normalize_path: true | ||
| http_filters: | ||
| - name: envoy.filters.http.dynamic_forward_proxy | ||
| typed_config: | ||
| "@type": type.googleapis.com/envoy.extensions.filters.http.dynamic_forward_proxy.v3.FilterConfig | ||
| dns_cache_config: | ||
| name: local_dns_cache | ||
| dns_lookup_family: V4_ONLY | ||
| - 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: | ||
| - name: forward_proxy | ||
| domains: ["*"] | ||
| routes: | ||
| - match: { connect_matcher: {} } | ||
| route: | ||
| cluster: dynamic_forward_proxy_cluster | ||
| upgrade_configs: | ||
| - upgrade_type: CONNECT | ||
| connect_config: {} | ||
| - match: { prefix: "/" } | ||
| route: | ||
| cluster: dynamic_forward_proxy_cluster | ||
| access_log: | ||
| - name: envoy.access_loggers.stdout | ||
| typed_config: | ||
| "@type": type.googleapis.com/envoy.extensions.access_loggers.stream.v3.StdoutAccessLog | ||
| log_format: | ||
| text_format: "[%START_TIME%] %DOWNSTREAM_REMOTE_ADDRESS% %REQ(:method)% %REQ(:authority)% %REQ(:path)% -> %RESPONSE_CODE% (%BYTES_SENT%b) %DURATION%ms %RESPONSE_FLAGS% %UPSTREAM_TRANSPORT_FAILURE_REASON%\n" | ||
|
|
||
| clusters: | ||
| - name: dynamic_forward_proxy_cluster | ||
| connect_timeout: 5s | ||
| lb_policy: CLUSTER_PROVIDED | ||
| typed_extension_protocol_options: | ||
| envoy.extensions.upstreams.http.v3.HttpProtocolOptions: | ||
| "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions | ||
| explicit_http_config: | ||
| http_protocol_options: {} | ||
| upstream_http_protocol_options: | ||
| auto_sni: true | ||
| auto_san_validation: true | ||
| cluster_type: | ||
| name: envoy.clusters.dynamic_forward_proxy | ||
| typed_config: | ||
| "@type": type.googleapis.com/envoy.extensions.clusters.dynamic_forward_proxy.v3.ClusterConfig | ||
| dns_cache_config: | ||
| name: local_dns_cache | ||
| dns_lookup_family: V4_ONLY | ||
|
|
||
| admin: | ||
| address: | ||
| socket_address: { address: 127.0.0.1, port_value: 9901 } | ||
|
|
||
|
|
This file contains hidden or 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,36 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -o pipefail -o errexit -o nounset | ||
|
|
||
| echo "[envoy-init] Preparing Envoy bootstrap configuration" | ||
| mkdir -p /etc/envoy | ||
|
|
||
| render_from_template=false | ||
| if [[ -f /etc/envoy/templates/bootstrap.yaml && -n "${INST_NAME:-}" && -n "${METRO_NAME:-}" ]]; then | ||
| render_from_template=true | ||
| fi | ||
|
|
||
| if $render_from_template; then | ||
| echo "[envoy-init] Rendering template with INST_NAME=${INST_NAME} and METRO_NAME=${METRO_NAME}" | ||
| inst_esc=$(printf '%s' "$INST_NAME" | sed -e 's/[\/&]/\\&/g') | ||
| metro_esc=$(printf '%s' "$METRO_NAME" | sed -e 's/[\/&]/\\&/g') | ||
| sed -e "s|{INSTANCE_NAME}|$inst_esc|g" \ | ||
| -e "s|{METRO_NAME}|$metro_esc|g" \ | ||
| /etc/envoy/templates/bootstrap.yaml > /etc/envoy/bootstrap.yaml | ||
| else | ||
| echo "[envoy-init] Using default configuration (template vars INST_NAME and METRO_NAME not provided)" | ||
| fi | ||
|
|
||
| echo "[envoy-init] Starting Envoy via supervisord" | ||
| supervisorctl -c /etc/supervisor/supervisord.conf start envoy | ||
| echo "[envoy-init] Waiting for Envoy admin on 127.0.0.1:9901..." | ||
| for i in {1..50}; do | ||
| if (echo >/dev/tcp/127.0.0.1/9901) >/dev/null 2>&1; then | ||
| echo "[envoy-init] Envoy is started" | ||
| break | ||
| fi | ||
| sleep 0.1 | ||
| if [[ $i -eq 50 ]]; then | ||
| echo "[envoy-init] Failed to start Envoy - admin interface not responding after 5 seconds" | ||
| fi | ||
| done | ||
sjmiller609 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
cursor[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or 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,9 @@ | ||
| [program:envoy] | ||
| command=/bin/bash -lc 'set -e; args="-c /etc/envoy/bootstrap.yaml --log-level ${ENVOY_LOG_LEVEL:-info}"; [ -n "${ENVOY_NODE_ID:-}" ] && args="$args --service-node=${ENVOY_NODE_ID}"; [ -n "${ENVOY_CLUSTER:-}" ] && args="$args --service-cluster=${ENVOY_CLUSTER}"; exec envoy $args' | ||
| autostart=false | ||
| autorestart=true | ||
| startsecs=2 | ||
| stdout_logfile=/var/log/supervisord/envoy | ||
| redirect_stderr=true | ||
|
|
||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.