Istio试点发现http api文档



pilot discovery已经公开了http服务,但上面没有文档。我如何通过pilot api进行查询,比如列出所有注册的服务?

我刚刚找到了相关的文档和代码:

调试接口:

https://github.com/istio/istio/tree/master/pilot/pkg/proxy/envoy/v2

PILOT=istio-pilot.istio-system:9093
# What is sent to envoy
# Listeners and routes
curl $PILOT/debug/adsz
# Endpoints
curl $PILOT/debug/edsz
# Clusters
curl $PILOT/debug/cdsz
# General metrics
curl $PILOT/metrics
# All services/external services from all registries
curl $PILOT/debug/registryz
# All endpoints
curl $PILOT/debug/endpointz[?brief=1]
# All configs.
curl $PILOT/debug/configz

列出所有终结点:/v1/注册

https://github.com/istio/istio/blob/master/pilot/pkg/proxy/envoy/discovery.go#L141

pprof
/debug/pprof/
healthz
/ready

mux.HandleFunc("/debug/edsz", s.edsz)
mux.HandleFunc("/debug/adsz", s.adsz)
mux.HandleFunc("/debug/cdsz", cdsz)
mux.HandleFunc("/debug/syncz", Syncz)
mux.HandleFunc("/debug/registryz", s.registryz)
mux.HandleFunc("/debug/endpointz", s.endpointz)
mux.HandleFunc("/debug/endpointShardz", s.endpointShardz)
mux.HandleFunc("/debug/workloadz", s.workloadz)
mux.HandleFunc("/debug/configz", s.configz)
mux.HandleFunc("/debug/authenticationz", s.authenticationz)
mux.HandleFunc("/debug/config_dump", s.ConfigDump)
mux.HandleFunc("/debug/push_status", s.PushStatusHandler)

我这样使用它,它很有效。在istio 1.7 上测试

连接到istiod:

kubectl exec -ti < istiod-pod-name > -c discovery -n istio-system -- /bin/bash

运行飞行员发现命令:

pilot-discovery request get metrics | grep citadel

最新更新