higress icon indicating copy to clipboard operation
higress copied to clipboard

Add Custom Discoverer interface

Open dongjiang1989 opened this issue 1 year ago • 4 comments

Why do you need it?

Is your feature request related to a problem? Please describe in details

Design the Discoverer interface, with target group

type Discoverer interface {
	Run(ctx context.Context, up chan<- []*targetgroup.Group)
}

target group may be link:

[]targetgroup.Group{
	{
		Targets: []model.LabelSet{
			{
				"__instance__": "10.11.150.1:7870",
				"hostname":     "demo-target-1",
                                 "protocol": ["http", "dubbo", "grpc"],
			},
			{
				"__instance__": "10.11.150.4:7870",
				"hostname":     "demo-target-2",
			},
		},
		Labels: model.LabelSet{
			"job": "mysql",
		},
	},
        ....

How could it be?

A clear and concise description of what you want to happen. You can explain more about input of the feature, and output of it.

Users can add custom registration centers through standard interfaces.

like: xds and http watch model

Other related information

Add any other context or screenshots about the feature request here.

dongjiang1989 avatar Jan 09 '24 08:01 dongjiang1989

/cc @johnlanni

dongjiang1989 avatar Jan 10 '24 08:01 dongjiang1989

In fact, there is no need to design a new general mechanism. You can directly use istio's MCP specification. You can refer to Nacos' MCP server implementation. Higress can also support service discovery in this way.

https://nacos.io/zh-cn/blog/pilot%20mcp.html

johnlanni avatar Jan 10 '24 11:01 johnlanni

In fact, there is no need to design a new general mechanism. You can directly use istio's MCP specification. You can refer to Nacos' MCP server implementation. Higress can also support service discovery in this way.

https://nacos.io/zh-cn/blog/pilot%20mcp.html

Support mcp v1alpha1 interface? https://github.com/istio/api/tree/master/mcp/v1alpha1

dongjiang1989 avatar Jan 11 '24 09:01 dongjiang1989

@dongjiang1989 Yes, you can see the nacos code here: https://github.com/alibaba/nacos/blob/a7d1c35f85362a4538e81a721ab94b6bceeb714e/istio/src/main/java/com/alibaba/nacos/istio/mcp/NacosMcpService.java

johnlanni avatar Jan 12 '24 03:01 johnlanni