control-plane 接続前後の envoy の状態を確認する。
実験手順
前回、あらかじめ実験手順を書いておくと作業しやすいことが分かったw
- envoy.yaml に admin セクションを追加
- envoy 起動
- stats 確認
- controle-plane 起動
- stats 確認
実験
envoy.yaml に admin セクションを追加
admin:
access_log_path: /tmp/admin_access.log
address:
socket_address:
protocol: TCP
address: 127.0.0.1
port_value: 9901
envoy 起動
# docker run \
--name envoy --rm \
--net=host \
-v /tmp/envoy:/etc/envoy \
envoyproxy/envoy:v1.10.0
control_plain 起動前の stats 取得
# curl -H 'Host: hello.local' 127.0.0.1 no healthy upstream # curl localhost:9901/stats > 1_stats # curl localhost:9901/config_dump > 1_config_dump # curl localhost:9901/clusters > 1_clusters
control_plain 起動し stats 取得
# curl -H 'Host: hello.local' 127.0.0.1
<h3>My hostname is 9c2075e4f35a</h3> </body>
# curl localhost:9901/stats > 2_stats
# curl localhost:9901/config_dump > 2_config_dump
# curl localhost:9901/clusters > 2_clusters
結果
controlplane から送り込まれたエンドポイントが config_dump に差し込まれるのかと思っていたが、そうではなかった。 clusters に入っていた。
clusters に追加されていたブロック
hello_cluster::127.0.0.1:8080::cx_active::1 hello_cluster::127.0.0.1:8080::cx_connect_fail::0 hello_cluster::127.0.0.1:8080::cx_total::1 hello_cluster::127.0.0.1:8080::rq_active::0 hello_cluster::127.0.0.1:8080::rq_error::0 hello_cluster::127.0.0.1:8080::rq_success::1 hello_cluster::127.0.0.1:8080::rq_timeout::0 hello_cluster::127.0.0.1:8080::rq_total::1 hello_cluster::127.0.0.1:8080::health_flags::healthy hello_cluster::127.0.0.1:8080::weight::1 hello_cluster::127.0.0.1:8080::region:: hello_cluster::127.0.0.1:8080::zone:: hello_cluster::127.0.0.1:8080::sub_zone:: hello_cluster::127.0.0.1:8080::canary::false hello_cluster::127.0.0.1:8080::success_rate::-1