|
| 1 | +--- |
| 2 | +title: Envoy baseline testing on Google Axion C4A Arm Virtual machine |
| 3 | +weight: 5 |
| 4 | + |
| 5 | +### FIXED, DO NOT MODIFY |
| 6 | +layout: learningpathall |
| 7 | +--- |
| 8 | + |
| 9 | + |
| 10 | +Since Envoy is installed successfully on your GCP C4A Arm virtual machine, follow these steps to validate that the Envoy is running. |
| 11 | + |
| 12 | +## Validate Envoy installation with a baseline test |
| 13 | + |
| 14 | +In this section, we covered how to create a minimal Envoy config, start Envoy with it, and verify functionality using `curl`. |
| 15 | +The test confirmed that Envoy listens on port **10000**, forwards requests to `httpbin.org`, and returns a successful **200 OK** response. |
| 16 | + |
| 17 | +### Create a Minimal Configuration File |
| 18 | + |
| 19 | +Using a file editor of your choice, create a file named `envoy_config.yaml`, and add the below content to it. This file configures Envoy to listen on port **10000** and forward all traffic to `http://httpbin.org`. The host_rewrite_literal is essential to prevent 404 Not Found errors from the upstream server. |
| 20 | + |
| 21 | +```YAML |
| 22 | +static_resources: |
| 23 | + listeners: |
| 24 | + - name: listener_0 |
| 25 | + address: |
| 26 | + socket_address: |
| 27 | + protocol: TCP |
| 28 | + address: 0.0.0.0 |
| 29 | + port_value: 10000 |
| 30 | + filter_chains: |
| 31 | + - filters: |
| 32 | + - name: envoy.filters.network.http_connection_manager |
| 33 | + typed_config: |
| 34 | + "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager |
| 35 | + stat_prefix: ingress_http |
| 36 | + route_config: |
| 37 | + name: local_route |
| 38 | + virtual_hosts: |
| 39 | + - name: backend |
| 40 | + domains: ["*"] |
| 41 | + routes: |
| 42 | + - match: |
| 43 | + prefix: "/" |
| 44 | + route: |
| 45 | + cluster: service_httpbin |
| 46 | + host_rewrite_literal: httpbin.org |
| 47 | + http_filters: |
| 48 | + - name: envoy.filters.http.router |
| 49 | + typed_config: |
| 50 | + "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router |
| 51 | + clusters: |
| 52 | + - name: service_httpbin |
| 53 | + connect_timeout: 0.5s |
| 54 | + type: LOGICAL_DNS |
| 55 | + dns_lookup_family: V4_ONLY |
| 56 | + lb_policy: ROUND_ROBIN |
| 57 | + load_assignment: |
| 58 | + cluster_name: service_httpbin |
| 59 | + endpoints: |
| 60 | + - lb_endpoints: |
| 61 | + - endpoint: |
| 62 | + address: |
| 63 | + socket_address: |
| 64 | + address: httpbin.org |
| 65 | + port_value: 80 |
| 66 | +``` |
| 67 | +- **Listeners:** Envoy is configured to accept incoming HTTP requests on port **10000** of your VM. |
| 68 | +- **HTTP Connection Manager:** A filter processes the incoming requests, directing them to the appropriate backend. |
| 69 | +- **Routing:** All traffic is routed to the `service_httpbin` cluster, with the `Host` header rewritten to `httpbin.org`. |
| 70 | +- **Clusters:** The `service_httpbin` cluster defines the upstream service as `httpbin.org` on port **80**, which is where requests are ultimately forwarded. |
| 71 | + |
| 72 | +### Run and Test Envoy |
| 73 | + |
| 74 | +This is the final phase of functional validation, confirming that the proxy is operational. |
| 75 | +Start the Envoy proxy using your configuration file. This command will keep the terminal occupied, so you will need a new terminal for the next step. |
| 76 | + |
| 77 | +```console |
| 78 | + envoy -c envoy_config.yaml --base-id 1 |
| 79 | +``` |
| 80 | +The output should look similar to: |
| 81 | + |
| 82 | +```output |
| 83 | +[2025-08-21 11:53:51.597][67137][info][config] [source/server/configuration_impl.cc:138] loading 1 listener(s) |
| 84 | +[2025-08-21 11:53:51.597][67137][info][config] [source/server/configuration_impl.cc:154] loading stats configuration |
| 85 | +[2025-08-21 11:53:51.598][67137][warning][main] [source/server/server.cc:928] There is no configured limit to the number of allowed active downstream connections. Configure a limit in `envoy.resource_monitors.downstream_connections` resource monitor. |
| 86 | +[2025-08-21 11:53:51.598][67137][info][main] [source/server/server.cc:969] starting main dispatch loop |
| 87 | +[2025-08-21 11:53:51.599][67137][info][runtime] [source/common/runtime/runtime_impl.cc:614] RTDS has finished initialization |
| 88 | +[2025-08-21 11:53:51.599][67137][info][upstream] [source/common/upstream/cluster_manager_impl.cc:240] cm init: all clusters initialized |
| 89 | +[2025-08-21 11:53:51.599][67137][info][main] [source/server/server.cc:950] all clusters initialized. initializing init manager |
| 90 | +[2025-08-21 11:53:51.599][67137][info][config] [source/common/listener_manager/listener_manager_impl.cc:930] all dependencies initialized. starting workers |
| 91 | +``` |
| 92 | + |
| 93 | +Now, **Send a test request** from another terminal window to the Envoy listener using `curl`. |
| 94 | + |
| 95 | +```console |
| 96 | +curl -v http://localhost:10000/get |
| 97 | +``` |
| 98 | +The `-v` flag provides verbose output, showing the full request and response headers. A successful test will show a **HTTP/1.1 200 OK** response with a JSON body from httpbin.org. |
| 99 | + |
| 100 | +The output should look similar to: |
| 101 | + |
| 102 | +```output |
| 103 | +* Trying 127.0.0.1:10000... |
| 104 | +* Connected to 127.0.0.1 (127.0.0.1) port 10000 (#0) |
| 105 | +> GET /get HTTP/1.1 |
| 106 | +> Host: 127.0.0.1:10000 |
| 107 | +> User-Agent: curl/7.76.1 |
| 108 | +> Accept: */* |
| 109 | +> |
| 110 | +* Mark bundle as not supporting multiuse |
| 111 | +< HTTP/1.1 200 OK |
| 112 | +< date: Fri, 22 Aug 2025 11:20:35 GMT |
| 113 | +< content-type: application/json |
| 114 | +< content-length: 301 |
| 115 | +< server: envoy |
| 116 | +< access-control-allow-origin: * |
| 117 | +< access-control-allow-credentials: true |
| 118 | +< x-envoy-upstream-service-time: 1042 |
| 119 | +< |
| 120 | +{ |
| 121 | + "args": {}, |
| 122 | + "headers": { |
| 123 | + "Accept": "*/*", |
| 124 | + "Host": "httpbin.org", |
| 125 | + "User-Agent": "curl/7.76.1", |
| 126 | + "X-Amzn-Trace-Id": "Root=1-68a85282-10af9cfe0385774600509ddd", |
| 127 | + "X-Envoy-Expected-Rq-Timeout-Ms": "15000" |
| 128 | + }, |
| 129 | + "origin": "34.63.220.63", |
| 130 | + "url": "http://httpbin.org/get" |
| 131 | +} |
| 132 | +* Connection #0 to host 127.0.0.1 left intact |
| 133 | +``` |
| 134 | +#### Summary of the curl Output |
| 135 | + |
| 136 | +- **Successful Connection:** The **curl** command successfully connected to the Envoy proxy on **localhost:10000**. |
| 137 | +- **Correct Status Code:** Envoy successfully forwarded the request and received a healthy **200 OK** response from the upstream server. |
| 138 | +- **Host Header Rewrite:** The **Host** header was correctly rewritten from **localhost:10000** to **httpbin.org** as defined in the configuration. |
| 139 | +- **End-to-End Success:** The proxy is fully operational, proving that requests are correctly received, processed, and forwarded to the intended backend. |
| 140 | + |
| 141 | +This confirms the end-to-end flow is working correctly. |
0 commit comments