You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I didn't see any references to unix domain socket in the additional context link you cited so I didn't see how it is related.
Are you saying the istio control plane returned unix: addresses as endpoints and the gRPC code dropped them even before using your NameResolver for UDS?
Drat. Well, I guess this will be a forcing function to finishing #4750 and its dependencies. We've slowly been moving in that direction, so luckily the ChannelCredentials paved the way partly already.
Then I write a simple NameResolverProvider that it just returns DomainSocketAddress, but it doesn't work.
That should have worked. We know that would fail if OkHttp were in the mix or if Netty wasn't using epoll, and there are issues with grpc-netty vs grpc-netty-shaded. But you didn't hit any of those (yet) from the error. That error claims your name resolver didn't provide any addresses at all. @naoh87, can you paste code that prepares the data to return to the listener? I think there is something simple going on.
@sanjaypujare, FYI, fixing this means fixing #3085 which means methods like ServerProvider.provider() will no longer be used at all by gRPC, as we'll always need to be prepared to try multiple transports. We can leave it in place temporarily, but it will need to be deleted eventually.
@costinm, I should have noticed this earlier when looking at that blog post. It would certainly need a hack today (like making your own NR). If TCP is available, that'd be great. But it also seems like it is time for us to get the plumbing to allow UDS.
The NR itself is very easy and would be relatively (compared to others) small. But without the plumbing it would make multiple (mostly right) assumptions about the environment.
Unfortunately the XDS proxy in the agent only support UDS, but at least for testing it should be possible to use a custom bootstrap file that connects directly to istiod.istio-system on the plain text port. The main purpose of the XDS proxy in the agent is to deal with the custom certificate and auth - ideally we shouldn't need it, but right now in Istio we just have too many ways to authenticate and get certificates.
Now I'm confused. 😅 I asked if it was enough with only a different NameResolverProvider, and you said yes, showing that SdsClient is already providing an EpollDomainSocketChannel...
...
Will it be enough with only a different NameResolverProvider? Because UDS requires a different socket channel as well (EpollDomainSocketChannel).
yes, ...
But then I do actually need a ManagedChannelProvider as well?
Now I'm confused. 😅 I asked if it was enough with only a different NameResolverProvider, and you said yes, showing that SdsClient is already providing an EpollDomainSocketChannel...
SdsClient has been removed and is a different client (not the XdsClient that we want here). My link was to an older version (1.40.x) if you notice...
...
Will it be enough with only a different NameResolverProvider? Because UDS requires a different socket channel as well (EpollDomainSocketChannel).
yes, ...
But then I do actually need a ManagedChannelProvider as well?
Looks like that because that's the only one that can provide the channelType we were talking about.
Thanks, now it's clear. Something like this seems to work. but like @ejona86 says it's a bit brittle.
What would a "proper" solution be? I may attempt a PR.
But you also need to register this in ManagedChannelRegistry and would you do that thru the Service Provider interface?
Yes.
I'll let @ejona86 answer that. It will be good if you can contribute a PR - since this functionality is sorely needed.
A partly related question; since this will give the client the capability to connect over UDS, should the same be done for server as well? I.e. something like this would be needed somewhere:
...
A partly related question; since this will give the client the capability to connect over UDS, should the same be done for server as well? I.e. something like this would be needed somewhere:
"client" in this context can be confusing. In this case gRPC (the library) only needs the XdsClient to be able to instantiate a gRPC client over UDS to talk to the Istio agent (which is the XDS server although just a proxy). Even if one is creating an XDS managed gRPC server (check out io.grpc.xds.XdsServerBuilder) it still needs only the XdsClient (containing a gRPC client) to talk to the Istio agent (over UDS in this case).
So something like what you are describing i.e. creating a NettyServer using UDS to receive incoming RPCs is not needed.
So something like what you are describing i.e. creating a NettyServer using UDS to receive incoming RPCs is not needed.
Well it wouldn't be needed for the issue discussed here (xDS over UDS), but the fixes discussed here would also allow any other grpc-java client to connect to any server over UDS.
So my question is rather if there should be an easier way to create a server for UDS? As this will allow out-of-the-box support for creating both a client and server over UDS. E.g. something like?
So my question is rather if there should be an easier way to create a server for UDS? As this will allow out-of-the-box support for creating both a client and server over UDS. E.g. something like?
The design for #3085 is essentially add Collection<SocketAddress> getSupportedSocketAddresses() to NameResolverProvider and ManagedChannelProvider. ManagedChannelRegistry would use the target string to determine which NameResolverProvider would be used. It will then loop through ManagedChannelProviders in order until one supports all the addresses returned by the NameResolverProvider. And then for this issue we add unix name resolver and a unix variant for Netty.
I think @sanjaypujare was looking at implementing this, although I'd imagine he'd be happy handing it off. He has some stuff written up in a random doc; he could potentially share it with you.
Activity
sanjaypujare commentedon Feb 3, 2022
I didn't see any references to unix domain socket in the additional context link you cited so I didn't see how it is related.
Are you saying the istio control plane returned
unix:addresses as endpoints and the gRPC code dropped them even before using your NameResolver for UDS?ejona86 commentedon Feb 3, 2022
Drat. Well, I guess this will be a forcing function to finishing #4750 and its dependencies. We've slowly been moving in that direction, so luckily the ChannelCredentials paved the way partly already.
That should have worked. We know that would fail if OkHttp were in the mix or if Netty wasn't using epoll, and there are issues with grpc-netty vs grpc-netty-shaded. But you didn't hit any of those (yet) from the error. That error claims your name resolver didn't provide any addresses at all. @naoh87, can you paste code that prepares the data to return to the listener? I think there is something simple going on.
@sanjaypujare, FYI, fixing this means fixing #3085 which means methods like
ServerProvider.provider()will no longer be used at all by gRPC, as we'll always need to be prepared to try multiple transports. We can leave it in place temporarily, but it will need to be deleted eventually.@sanjaypujare, Istio uses a control plane proxy in the local environment and the client connects to it over UDS. See this diagram from the blog post: https://istio.io/latest/blog/2021/proxyless-grpc/architecture.svg
sanjaypujare commentedon Feb 3, 2022
Thanks, I did search for "UDS" on that page :-) Should be a good feature in Chrome (and other browsers) to OCR the embedded images in the text search.
costinm commentedon Feb 3, 2022
I'll take a look, we may need to use TCP for java.
ejona86 commentedon Feb 3, 2022
@costinm, I should have noticed this earlier when looking at that blog post. It would certainly need a hack today (like making your own NR). If TCP is available, that'd be great. But it also seems like it is time for us to get the plumbing to allow UDS.
The NR itself is very easy and would be relatively (compared to others) small. But without the plumbing it would make multiple (mostly right) assumptions about the environment.
costinm commentedon Feb 3, 2022
Yes, java support for UDS would be very nice.
Unfortunately the XDS proxy in the agent only support UDS, but at least for testing it should be possible to use a custom bootstrap file that connects directly to istiod.istio-system on the plain text port. The main purpose of the XDS proxy in the agent is to deal with the custom certificate and auth - ideally we shouldn't need it, but right now in Istio we just have too many ways to authenticate and get certificates.
naoh87 commentedon Feb 7, 2022
Sorry for my late reply @ejona86
I tried this NR just call onAddress in start.
And I tried also add or not add epoll dependency. Both case cause same result.
It may not matter I used grpc-java from Scala.
cfredri4 commentedon Mar 8, 2022
Will it be enough with only a different NameResolverProvider? Because UDS requires a different socket channel as well (
EpollDomainSocketChannel).8 remaining items
cfredri4 commentedon Mar 8, 2022
Now I'm confused. 😅 I asked if it was enough with only a different
NameResolverProvider, and you said yes, showing thatSdsClientis already providing anEpollDomainSocketChannel...But then I do actually need a
ManagedChannelProvideras well?sanjaypujare commentedon Mar 8, 2022
SdsClienthas been removed and is a different client (not the XdsClient that we want here). My link was to an older version (1.40.x) if you notice...Looks like that because that's the only one that can provide the channelType we were talking about.
cfredri4 commentedon Mar 9, 2022
Thanks, now it's clear.
Something like this seems to work. but like @ejona86 says it's a bit brittle.
What would a "proper" solution be? I may attempt a PR.
sanjaypujare commentedon Mar 9, 2022
But you also need to register this in
ManagedChannelRegistryand would you do that thru the Service Provider interface?I'll let @ejona86 answer that. It will be good if you can contribute a PR - since this functionality is sorely needed.
cfredri4 commentedon Mar 10, 2022
Yes.
A partly related question; since this will give the client the capability to connect over UDS, should the same be done for server as well? I.e. something like this would be needed somewhere:
sanjaypujare commentedon Mar 10, 2022
"client" in this context can be confusing. In this case gRPC (the library) only needs the XdsClient to be able to instantiate a gRPC client over UDS to talk to the Istio agent (which is the XDS server although just a proxy). Even if one is creating an XDS managed gRPC server (check out
io.grpc.xds.XdsServerBuilder) it still needs only the XdsClient (containing a gRPC client) to talk to the Istio agent (over UDS in this case).So something like what you are describing i.e. creating a NettyServer using UDS to receive incoming RPCs is not needed.
cfredri4 commentedon Mar 10, 2022
Well it wouldn't be needed for the issue discussed here (xDS over UDS), but the fixes discussed here would also allow any other grpc-java client to connect to any server over UDS.
So my question is rather if there should be an easier way to create a server for UDS? As this will allow out-of-the-box support for creating both a client and server over UDS. E.g. something like?
sanjaypujare commentedon Mar 10, 2022
Okay I see what you are saying. But:
cfredri4 commentedon Mar 23, 2022
@ejona86 any thoughts?
ejona86 commentedon Mar 23, 2022
The design for #3085 is essentially add
Collection<SocketAddress> getSupportedSocketAddresses()to NameResolverProvider and ManagedChannelProvider. ManagedChannelRegistry would use the target string to determine which NameResolverProvider would be used. It will then loop through ManagedChannelProviders in order until one supports all the addresses returned by the NameResolverProvider. And then for this issue we add unix name resolver and a unix variant for Netty.I think @sanjaypujare was looking at implementing this, although I'd imagine he'd be happy handing it off. He has some stuff written up in a random doc; he could potentially share it with you.
sanjaypujare commentedon Mar 23, 2022
@cfredri4 if you are interested in submitting a PR I can share my doc with you. Let me know