InfraLab
ENVOY-ISTIO39 cmd

Envoy / Istio チート集

Envoy admin API、listener/route/cluster、HTTP filter、Istio の VirtualService、DestinationRule、Gateway、mTLS、proxy-config デバッグを整理したチート集。

更新日
2026-05-14
参照範囲
公式ドキュメント / man page / 主要ベンダーCLI
対象実装
主要 Linux / BSD / ネットワーク機器 CLI の一般的な実装
免責
OS とバージョン差分は実環境で確認してください。

39 / 39

CommandDescriptionExampleCopy
/clustersEnvoy admin API で cluster 状態を確認する。curl -s http://127.0.0.1:9901/clusters | head -40
/config_dump現在の xDS/静的設定を JSON で取得する。curl -s http://127.0.0.1:9901/config_dump | jq .configs[0]
/stats全メトリクスを表示する。curl -s http://127.0.0.1:9901/stats | grep upstream_rq_5xx
/loggingログレベル一覧を表示する。curl -s http://127.0.0.1:9901/logging
/logging?level=debug全体ログレベルを debug に変更する。curl -X POST "http://127.0.0.1:9901/logging?level=debug"
/readyEnvoy の readiness を確認する。curl -i http://127.0.0.1:9901/ready
listener yamlHTTP listener の最小構造。static_resources: listeners: - name: listener_0 address: socket_address: { address: 0.0.0.0, port_value: 10000 }
virtual_host routeHost と prefix で route を定義する。virtual_hosts: - name: backend domains: ["example.com"] routes: - match: { prefix: "/api" } route: { cluster: api_cluster }
cluster strict_dnsDNS 解決する upstream cluster を定義する。clusters: - name: api_cluster type: STRICT_DNS connect_timeout: 2s load_assignment: cluster_name: api_cluster
cluster logical_dns単一 DNS 名を論理 host として扱う。clusters: - name: ext_api type: LOGICAL_DNS dns_lookup_family: V4_ONLY load_assignment: { cluster_name: ext_api }
route timeoutroute 単位の timeout を指定する。route: cluster: api_cluster timeout: 3s
retry_policy5xx と connect-failure を再試行する。retry_policy: retry_on: 5xx,connect-failure num_retries: 2 per_try_timeout: 1s
router filterHTTP ルーティングの終端 filter。- name: envoy.filters.http.router typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
fault filter遅延やエラーを注入する。- name: envoy.filters.http.fault typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.fault.v3.HTTPFault delay: { fixed_delay: 2s, percentage: { numerator: 10 } }
cors filterCORS レスポンスを制御する。- name: envoy.filters.http.cors typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors
rate_limit filter外部 rate limit service と連携する。- name: envoy.filters.http.ratelimit typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.ratelimit.v3.RateLimit domain: edge
ext_authz filter外部認可サービスへ問い合わせる。- name: envoy.filters.http.ext_authz typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.ext_authz.v3.ExtAuthz grpc_service: { envoy_grpc: { cluster_name: authz } }
lua filterLua でヘッダを付与する。- name: envoy.filters.http.lua typed_config: "@type": type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua inline_code: "function envoy_on_response(h) h:headers():add("x-envoy","ok") end"
istioctl analyzeIstio 設定の静的解析を行う。istioctl analyze -A
istioctl proxy-statusEnvoy と control plane の同期状態を確認する。istioctl proxy-status
istioctl proxy-config clustersPod の cluster 設定を確認する。istioctl proxy-config clusters deploy/web -n prod
istioctl pc routes -o jsonroute 設定を JSON で確認する。istioctl pc routes deploy/web -n prod -o json | jq .[0].virtualHosts[0].routes[0]
istioctl pc listenerslistener 設定を確認する。istioctl pc listeners pod/web-6c9d9f -n prod
VirtualService minimalHTTP route の最小例。apiVersion: networking.istio.io/v1 kind: VirtualService metadata: { name: web } spec: hosts: ["web.example.com"] http: - route: - destination: { host: web.prod.svc.cluster.local, port: { number: 80 } }
DestinationRule subsetsubset と trafficPolicy を定義する。apiVersion: networking.istio.io/v1 kind: DestinationRule metadata: { name: web } spec: host: web.prod.svc.cluster.local subsets: - name: v1 labels: { version: v1 }
Gateway minimalIngress Gateway の待受を定義する。apiVersion: networking.istio.io/v1 kind: Gateway metadata: { name: web-gw } spec: selector: { istio: ingressgateway } servers: - port: { number: 80, name: http, protocol: HTTP } hosts: ["web.example.com"]
PeerAuthentication STRICTnamespace 単位で mTLS を必須にする。apiVersion: security.istio.io/v1 kind: PeerAuthentication metadata: { name: default, namespace: prod } spec: mtls: { mode: STRICT }
AuthorizationPolicy allow特定 service account だけ許可する。apiVersion: security.istio.io/v1 kind: AuthorizationPolicy metadata: { name: allow-frontend, namespace: prod } spec: selector: { matchLabels: { app: web } } rules: - from: - source: { principals: ["cluster.local/ns/prod/sa/frontend"] }
namespace injection labelサイドカー自動注入を有効化する。kubectl label namespace prod istio-injection=enabled --overwrite
check sidecar injectionPod に istio-proxy が入ったか確認する。kubectl get pod -n prod web-6c9d9f -o jsonpath="{.spec.containers[*].name}"
mTLS mode check認証設定と証明書状態を確認する。istioctl authn tls-check web.prod.svc.cluster.local
proxy log level特定 proxy のログレベルを変更する。istioctl proxy-config log deploy/web -n prod --level http:debug,router:debug
envoy tapIstio proxy で HTTP tap を開始する。istioctl experimental proxy-config tap deploy/web -n prod --http-path /api
kubectl logs istio-proxysidecar のログを確認する。kubectl logs deploy/web -n prod -c istio-proxy --tail=100
pilot-agent requestPod 内から admin API を叩く。kubectl exec -n prod deploy/web -c istio-proxy -- pilot-agent request GET stats
istioctl x describeService/Pod 観点で設定衝突を確認する。istioctl experimental describe pod web-6c9d9f -n prod
config dump diff問題 Pod と正常 Pod の設定差分を取る。istioctl pc all pod/web-a -n prod -o json > /tmp/a.json istioctl pc all pod/web-b -n prod -o json > /tmp/b.json diff -u /tmp/a.json /tmp/b.json
proxy-status stale同期不良 proxy を抽出する。istioctl proxy-status | awk '$3 != "SYNCED" || $4 != "SYNCED" {print}'
istioctl versionclient/control plane/data plane のバージョンを確認する。istioctl version --remote=false
Related