A CLI tool to help debugging Envoy
You simply need to have Node.js installed
git clone https://github.com/djannot/envoyctl.git
cd envoyctl
npm install
You can then run node envoyctl.js
.
But you can also run npm link
to make it available through envoyctl
.
You can run envoyctl -h
to display the help.
But the basic usage is either:
envoyctl -f <Envoy config dump file>
or
cat <Envoy config dump file> | envoyctl -f -
It has been tested with both Gloo Edge and Istio.
For example, to see the configuratin of the Istio ingress gateway:
kubectl -n istio-system port-forward deploy/istio-ingressgateway 15000 &
PID=$!
sleep 3
curl localhost:15000/config_dump | envoyctl -f -
kill $PID
or with istioctl
(>= 1.10):
istioctl pc all deploy/istio-ingressgateway.istio-system -o json | envoyctl -f -
Here is an example of the output you can get:
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββ
β Dynamic listener β Route name β Domains β Match β Route β Per filter config β Cluster β Endpoints β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 0.0.0.0_8383 β 8383 β * β { β { β β { β β
β β β β "prefix": "/" β "cluster": "PassthroughCluster", β β "@type": "type.googleapis.com/envoy.config.clβ¦ β β
β β β β } β "timeout": "0s", β β "name": "PassthroughCluster", β β
β β β β β "max_grpc_timeout": "0s" β β "type": "ORIGINAL_DST", β β
β β β β β } β β "connect_timeout": "10s", β β
β β β β β β β "lb_policy": "CLUSTER_PROVIDED", β β
β β β β β β β "circuit_breakers": { β β
β β β β β β β "thresholds": [ β β
β β β β β β β { β β
β β β β β β β "max_connections": 4294967295, β β
β β β β β β β "max_pending_requests": 4294967295, β β
β β β β β β β "max_requests": 4294967295, β β
β β β β β β β "max_retries": 4294967295, β β
β β β β β β β "track_remaining": true β β
β β β β β β β } β β
β β β β β β β ] β β
β β β β β β β }, β β
β β β β β β β "typed_extension_protocol_options": { β β
β β β β β β β "envoy.extensions.upstreams.http.v3.HttpProβ¦ β β
β β β β β β β "@type": "type.googleapis.com/envoy.extenβ¦ β β
β β β β β β β "use_downstream_protocol_config": { β β
β β β β β β β "http_protocol_options": {}, β β
β β β β β β β "http2_protocol_options": { β β
β β β β β β β "max_concurrent_streams": 1073741824 β β
β β β β β β β } β β
β β β β β β β } β β
β β β β β β β } β β
β β β β β β β }, β β
β β β β β β β "filters": [ β β
β β β β β β β { β β
β β β β β β β "name": "istio.metadata_exchange", β β
β β β β β β β "typed_config": { β β
β β β β β β β "@type": "type.googleapis.com/udpa.typeβ¦ β β
β β β β β β β "type_url": "type.googleapis.com/envoy.β¦ β β
β β β β β β β "value": { β β
β β β β β β β "protocol": "istio-peer-exchange" β β
β β β β β β β } β β
β β β β β β β } β β
β β β β β β β } β β
β β β β β β β ] β β
β β β β β β β } β β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββ€
...
β virtualInbound β inbound|9080|| β * β { β { β β { β β
β β β β "prefix": "/" β "cluster": "inbound|9080||", β β "@type": "type.googleapis.com/envoy.config.clβ¦ β β
β β β β } β "timeout": "0s", β β "name": "inbound|9080||", β β
β β β β β "max_stream_duration": { β β "type": "ORIGINAL_DST", β β
β β β β β "max_stream_duration": "0s", β β "connect_timeout": "10s", β β
β β β β β "grpc_timeout_header_max": "0s" β β "lb_policy": "CLUSTER_PROVIDED", β β
β β β β β } β β "circuit_breakers": { β β
β β β β β } β β "thresholds": [ β β
β β β β β β β { β β
β β β β β β β "max_connections": 4294967295, β β
β β β β β β β "max_pending_requests": 4294967295, β β
β β β β β β β "max_requests": 4294967295, β β
β β β β β β β "max_retries": 4294967295, β β
β β β β β β β "track_remaining": true β β
β β β β β β β } β β
β β β β β β β ] β β
β β β β β β β }, β β
β β β β β β β "cleanup_interval": "60s", β β
β β β β β β β "upstream_bind_config": { β β
β β β β β β β "source_address": { β β
β β β β β β β "address": "127.0.0.6", β β
β β β β β β β "port_value": 0 β β
β β β β β β β } β β
β β β β β β β }, β β
β β β β β β β "metadata": { β β
β β β β β β β "filter_metadata": { β β
β β β β β β β "istio": { β β
β β β β β β β "config": "/apis/networking.istio.io/v1β¦ β β
β β β β β β β "services": [ β β
β β β β β β β { β β
β β β β β β β "host": "productpage.default.svc.clβ¦ β β
β β β β β β β "name": "productpage", β β
β β β β β β β "namespace": "default" β β
β β β β β β β } β β
β β β β β β β ] β β
β β β β β β β } β β
β β β β β β β } β β
β β β β β β β } β β
β β β β β β β } β β
ββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββ
Using glooctl
:
glooctl proxy dump | envoyctl -f -
You can also get endpoints info displayed if you include eds in the dump:
kubectl -n istio-system port-forward deploy/istio-ingressgateway 15000 &
PID=$!
sleep 3
curl localhost:15000/config_dump?include_eds | envoyctl -f -
kill $PID
There's also a web version available at https://envoyui.solo.io