-
Notifications
You must be signed in to change notification settings - Fork 30
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 all 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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,4 @@ recording/ | |
| .tmp/ | ||
| .rootfs/ | ||
| initrd | ||
| temp.sh | ||
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
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,66 @@ | ||
| # Envoy bootstrap configuration for xDS-managed proxy | ||
| # This config connects to a control plane for dynamic configuration management | ||
| # Requires: INST_NAME, METRO_NAME, XDS_SERVER, XDS_JWT environment variables | ||
|
|
||
| # Node identity sent to xDS server for configuration targeting, authenticated by JWT | ||
| node: | ||
| id: "{INST_NAME}-{METRO_NAME}" | ||
| cluster: "kernel" | ||
|
|
||
| # Dynamic configuration via xDS protocol | ||
| dynamic_resources: | ||
| # Aggregated Discovery Service - single gRPC stream for all config types | ||
| ads_config: | ||
| api_type: GRPC | ||
| transport_api_version: V3 | ||
| grpc_services: | ||
| - envoy_grpc: | ||
| # Reference to xDS server cluster below | ||
| cluster_name: xds_server | ||
| authority: "{XDS_SERVER}" | ||
| # Send JWT authentication for all xDS requests | ||
| initial_metadata: | ||
| - key: "authorization" | ||
| value: "Bearer {XDS_JWT}" | ||
|
|
||
| # Listener Discovery Service and Cluster Discovery Service use ADS | ||
| lds_config: | ||
| ads: {} | ||
| resource_api_version: V3 | ||
| cds_config: | ||
| ads: {} | ||
| resource_api_version: V3 | ||
|
|
||
| # Static configuration (always present) | ||
| static_resources: | ||
| clusters: | ||
| # xDS server: control plane for configuration | ||
| - name: xds_server | ||
| # Resolve hostname via DNS, for DNS lookup | ||
| type: STRICT_DNS | ||
| connect_timeout: 2s | ||
| http2_protocol_options: {} | ||
| dns_lookup_family: V4_ONLY | ||
| # TLS configuration for secure xDS connection | ||
| transport_socket: | ||
| name: envoy.transport_sockets.tls | ||
| typed_config: | ||
| # Uses TLS to verify xDS server, and SNI hostname for TLS handshake | ||
| "@type": type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext | ||
| sni: {XDS_SERVER} | ||
| load_assignment: | ||
| cluster_name: xds_server | ||
| endpoints: | ||
| - lb_endpoints: | ||
| - endpoint: | ||
| address: | ||
| socket_address: | ||
| address: {XDS_SERVER} | ||
| port_value: 443 | ||
|
|
||
| # Enable Envoy admin interface for debugging locally | ||
| # admin: | ||
| # address: | ||
| # socket_address: | ||
| # address: 0.0.0.0 | ||
| # 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,98 @@ | ||
| # HTTP forward proxy, direct egress to internet | ||
| static_resources: | ||
| listeners: | ||
| - name: http_explicit_forward_proxy | ||
| address: | ||
| # e.g. on chromium, set --proxy-server=http://127.0.0.1:3128 | ||
| socket_address: | ||
| address: 0.0.0.0 | ||
| port_value: 3128 | ||
| filter_chains: | ||
| # One filter chain for HTTP/1.1 proxy traffic | ||
| - filters: | ||
| # HTTP Connection Manager filter: | ||
| # this is handling the connection between the client and the proxy, | ||
| # which is an HTTP connection. | ||
| - 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 | ||
| # Enable forward proxy behavior | ||
| http_filters: | ||
| # Dynamic Forward Proxy filter: resolves upstreams on-the-fly and caches DNS | ||
| # Browsers send CONNECT to this proxy to tunnel HTTPS upstreams | ||
| # e.g. CONNECT target.example.com | ||
| # Envoy establishes a TCP tunnel to the target. | ||
| - 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 | ||
| # Router filter: actually routes/tunnels the request once target is known | ||
| # See what happens here down in route_config, slightly different | ||
| # for HTTPS vs HTTP upstream requests. | ||
| - 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: | ||
| # === HTTPS upstream traffic (CONNECT tunnel) === | ||
| # Handle CONNECT method for HTTPS tunneling (creates TCP tunnel) | ||
| # 'connect_matcher' is a special matcher that matches CONNECT requests | ||
| # "Note that CONNECT support is currently considered alpha in Envoy." | ||
| # https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#envoy-v3-api-field-config-route-v3-routematch-connect-matcher | ||
| - match: { connect_matcher: {} } | ||
| route: | ||
| # Use single DFP cluster; CONNECT handled via connect_config | ||
| cluster: dynamic_forward_proxy_cluster | ||
| # This tells Envoy to upgrade the connection to a TCP tunnel | ||
| # which we only do after getting the CONNECT request. | ||
| upgrade_configs: | ||
| - upgrade_type: CONNECT | ||
| connect_config: {} | ||
| # === HTTP upstream traffic (absolute-form proxy) === | ||
| # The client didn't send CONNECT, because it's an HTTP request. | ||
| - match: { prefix: "/" } | ||
| route: | ||
| # Same cluster for HTTP proxying | ||
| cluster: dynamic_forward_proxy_cluster | ||
| access_log: | ||
| # Access log sink: print one line per request to stdout | ||
| - 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" | ||
|
|
||
| # Connection pooling / load balancing to target(s) | ||
| 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 interface for debugging and monitoring | ||
| admin: | ||
| address: | ||
| # Admin interface (metrics, config dump, clusters, listeners). Not exposed publicly. | ||
| socket_address: { address: 127.0.0.1, port_value: 9901 } |
Oops, something went wrong.
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.