mcp-over-xds
initConfigSources
// 初始化一个ads client
xdsMCP, err := adsc.New(srcAddress.Host, &adsc.Config{
Meta: model.NodeMetadata{
Generator: "api",
}.ToStruct(),
InitialDiscoveryRequests: adsc.ConfigInitialRequests(),
})
if err != nil {
return fmt.Errorf("failed to dial XDS %s %v", configSource.Address, err)
}
// 初始化一个configstore
store := memory.Make(collections.Pilot)
// 初始化config controller
configController := memory.NewController(store)
// 初始化istio config stroe
xdsMCP.Store = model.MakeIstioStore(configController)
// 运行
err = xdsMCP.Run()
if err != nil {
return fmt.Errorf("MCP: failed running %v", err)
}
s.ConfigStores = append(s.ConfigStores, configController)
log.Warn("Started XDS config ", s.ConfigStores)ads run
handleMCP
MCP-OVER-XDS简单示例
部署istio
实现ads server
检查
Last updated