Comments (7)
The best way to go about this would be to use xDS and a management server that has the configuration as per the "rules". You could also achieve this using a Custom Resolver - but it would be static and a client upgrade would be in order to change the routing logic. Using a xDS management server gives you the dynamic Out of Band routing you might be looking for.
See: https://github.com/grpc/grpc-go/tree/master/examples/features/xds
from grpc-go.
Thanks for your suggestion!
Follow your suggestions, I deployed a grpc server and istio in k8s, and a grpc client will access the grpc server in my mac. However, I found that the client seemed to have an exception in parsing lds (The specific method of printing logs is in xds/xdsclient/authority.go::decodeAllResources). The result of this is that if the xds:/// prefix is used, the call will time out
The grpc-go version is 1.62.x, and the istio version is 1.20.3. I would like to ask if we have any restrictions on the istio version?
[decodeAllResources] name: 10.0.0.10_53, result: &{Name:10.0.0.10_53 Resource:0x14000099260}, err: network filters {[name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"} name:"envoy.filters.network.tcp_proxy" typed_config:{type_url:"type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy" value:"\n3outbound|53||kube-dns.kube-system.svc.cluster.local\x123outbound|53||kube-dns.kube-system.svc.cluster.local"}]} has unsupported network filter "type.googleapis.com/stats.PluginConfig" in filter {name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"}}
[decodeAllResources] name: 10.0.159.201_80, result: &{Name:10.0.159.201_80 Resource:0x14000099320}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 10.0.112.177_15021, result: &{Name:10.0.112.177_15021 Resource:0x140000993e0}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 0.0.0.0_80, result: &{Name:0.0.0.0_80 Resource:0x140000994a0}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 10.0.211.31_80, result: &{Name:10.0.211.31_80 Resource:0x14000099560}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 0.0.0.0_15014, result: &{Name:0.0.0.0_15014 Resource:0x14000099620}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 10.0.0.1_443, result: &{Name:10.0.0.1_443 Resource:0x140000996e0}, err: network filters {[name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"} name:"envoy.filters.network.tcp_proxy" typed_config:{type_url:"type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy" value:"\n2outbound|443||kubernetes.default.svc.cluster.local\x122outbound|443||kubernetes.default.svc.cluster.local"}]} has unsupported network filter "type.googleapis.com/stats.PluginConfig" in filter {name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"}}
[decodeAllResources] name: 10.0.220.75_8848, result: &{Name:10.0.220.75_8848 Resource:0x140000997a0}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 10.0.208.25_20001, result: &{Name:10.0.208.25_20001 Resource:0x14000099860}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 10.0.1.252_80, result: &{Name:10.0.1.252_80 Resource:0x14000099920}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 10.0.130.20_443, result: &{Name:10.0.130.20_443 Resource:0x140000999e0}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 10.0.245.146_15012, result: &{Name:10.0.245.146_15012 Resource:0x14000099aa0}, err: network filters {[name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"} name:"envoy.filters.network.tcp_proxy" typed_config:{type_url:"type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy" value:"\n5outbound|15012||istiod.istio-system.svc.cluster.local\x125outbound|15012||istiod.istio-system.svc.cluster.local"}]} has unsupported network filter "type.googleapis.com/stats.PluginConfig" in filter {name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"}}
[decodeAllResources] name: 10.0.245.146_443, result: &{Name:10.0.245.146_443 Resource:0x14000099b60}, err: network filters {[name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"} name:"envoy.filters.network.tcp_proxy" typed_config:{type_url:"type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy" value:"\n3outbound|443||istiod.istio-system.svc.cluster.local\x123outbound|443||istiod.istio-system.svc.cluster.local"}]} has unsupported network filter "type.googleapis.com/stats.PluginConfig" in filter {name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"}}
[decodeAllResources] name: 10.0.0.10_9153, result: &{Name:10.0.0.10_9153 Resource:0x14000099c20}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 192.168.41.1_10250, result: &{Name:192.168.41.1_10250 Resource:0x14000099ce0}, err: network filters {[name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"} name:"envoy.filters.network.tcp_proxy" typed_config:{type_url:"type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy" value:"\n5outbound|10250||kubelet.kube-system.svc.cluster.local\x125outbound|10250||kubelet.kube-system.svc.cluster.local"}]} has unsupported network filter "type.googleapis.com/stats.PluginConfig" in filter {name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"}}
[decodeAllResources] name: 10.0.220.75_9848, result: &{Name:10.0.220.75_9848 Resource:0x14000099da0}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 10.0.145.146_80, result: &{Name:10.0.145.146_80 Resource:0x14000099e60}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 10.0.112.177_443, result: &{Name:10.0.112.177_443 Resource:0x14000099f20}, err: network filters {[name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"} name:"envoy.filters.network.tcp_proxy" typed_config:{type_url:"type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy" value:"\nAoutbound|443||istio-ingressgateway.istio-system.svc.cluster.local\x12Aoutbound|443||istio-ingressgateway.istio-system.svc.cluster.local"}]} has unsupported network filter "type.googleapis.com/stats.PluginConfig" in filter {name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"}}
[decodeAllResources] name: 10.0.172.54_3306, result: &{Name:10.0.172.54_3306 Resource:0x140001a4180}, err: network filters {[name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"} name:"envoy.filters.network.tcp_proxy" typed_config:{type_url:"type.googleapis.com/envoy.extensions.filters.network.tcp_proxy.v3.TcpProxy" value:"\n4outbound|3306||demo-mysql.mse-demo.svc.cluster.local\x124outbound|3306||demo-mysql.mse-demo.svc.cluster.local"}]} has unsupported network filter "type.googleapis.com/stats.PluginConfig" in filter {name:"istio.stats" typed_config:{type_url:"type.googleapis.com/stats.PluginConfig"}}
[decodeAllResources] name: 10.0.239.31_20002, result: &{Name:10.0.239.31_20002 Resource:0x140001a4240}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 10.0.194.156_20003, result: &{Name:10.0.194.156_20003 Resource:0x140001a4360}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: 0.0.0.0_15010, result: &{Name:0.0.0.0_15010 Resource:0x140001a4480}, err: unsupported field 'listener_filters' contains 2 entries
[decodeAllResources] name: virtualOutbound, result: &{Name:virtualOutbound Resource:0x140001a4540}, err: unsupported field 'use_original_dst' is present and set to true
[decodeAllResources] name: virtualInbound, result: &{Name:virtualInbound Resource:0x140001a4600}, err: unsupported field 'listener_filters' contains 3 entries
from grpc-go.
I found that this code caused that the lds data returned by istio can not be parsed. May I ask why it is designed like this? Is it necessary to optimize here, because it is normal for lds to carry listener filter info now?
path: xds/internal/xdsclient/xdsresource/unmarshal_lds.go::processServerSideListener
func processServerSideListener(lis *v3listenerpb.Listener) (*ListenerUpdate, error) {
if n := len(lis.ListenerFilters); n != 0 {
return nil, fmt.Errorf("unsupported field 'listener_filters' contains %d entries", n)
}
...
from grpc-go.
I tried many ways, even modified the code, but still couldn't get through the xds client. Regarding the sample given, is there a bootstrap.json file that can be used for my reference?
from grpc-go.
From the logs, the code path that was likely invoked if you are using a xDS enabled gRPC server. And based on your initial question I dont think this is what you need. You would need the client to be using xDS.
Also regarding this, that particular scenario is called out in in gRFC A36 - xDS for servers, and talks about NACKing when listener filters are present. See: https://github.com/grpc/proposal/blob/ea5552587c5b93e978c4bcb695e2210ff97ccbf8/A36-xds-for-servers.md?plain=1#L160
from grpc-go.
This issue is labeled as requiring an update from the reporter, and no update has been received after 6 days. If no update is provided in the next 7 days, this issue will be automatically closed.
from grpc-go.
yes, i need use xDS in client scenarios. Maybe I'm using it incorrectly, but I didn't find the correct way to use it...It would be nice if the xds example has the instruction about bootstrap file. I guess my bootstrap is not written correctly.
from grpc-go.
Related Issues (20)
- stubserver: add support to optionally pass in a `grpc.Server` or `xds.GRPCServer` HOT 2
- Github Action: Codecov action is broken and is failing silently HOT 1
- Upgrade to using math/rand/v2 to get perf enhancements HOT 2
- xds: tests shouldn't rely on the presence of an entry in the `authorities` field of the bootstrap configuration with an empty key
- Experimental API related to metadata HOT 4
- Linter rule for using context.Background() without a timeout in tests HOT 4
- gRPC is incompatible with tls.Listener HOT 2
- Closing connection takes up to 15 minutes. HOT 5
- Feature Request: expose handleRawConn or add ServeConn HOT 26
- Flaky test: TimerAndWatchStateOnErrorCallback HOT 4
- xds: bootstrap config is not emitted to logs in a human readable way
- Strongly-type request inside a Stream Server Interceptor HOT 2
- Proxy connection buffer necessary? HOT 1
- Why does grpc.NewClient silently ignore DialOptions? HOT 2
- Make transport.SetConnection public? HOT 4
- what's the default max data size
- If a priority contains multiple localities with pick_first, load is reported incorrectly HOT 4
- NewClient doesn't work with WithContextDialer HOT 2
- xds: make the bootstrap configuration a singleton
- protoc gen adds comment, does not follow godoc. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grpc-go.