New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xds: support istio grpc-agent #8884
Comments
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 |
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 @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 |
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. |
I'll take a look, we may need to use TCP for java. |
@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. |
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. |
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. |
Will it be enough with only a different NameResolverProvider? Because UDS requires a different socket channel as well ( |
yes, you can look at https://github.com/grpc/grpc-java/blob/v1.39.x/xds/src/main/java/io/grpc/xds/internal/sds/SdsClient.java#L116 to see how this channel is created. Ideally this should be supported by |
@sanjaypujare, that's a different design than we had been discussing earlier. Earlier we were talking about adding a NameResolver (along with #3085 (comment)). Using a ManagedChannelProvider that way could be made to work, but seems brittle and heavily reliant on having a high |
Short term, something like this should make it work with Istio? |
@cfredri4 @ejona86 the NameResolver can return a So @cfredri4 how does your code take care of |
It does not, this would only be a short term fix for XDS (as you showed, SdsClient will detect and use a |
Okay so in your case you will have another place where you will set the channelType appropriately. Curious to see what that place will be. |
UDS is only needed for communication with the Istio agent/control plane. But then UDS is not needed when communicating with other services/data plane. |
Correct. But what I am saying is even to open that UDS channel to the Istio agent 2 things need to happen (from https://github.com/grpc/grpc-java/blob/v1.39.x/xds/src/main/java/io/grpc/xds/internal/sds/SdsClient.java#L116)
If you trace the flow from the |
Now I'm confused. 😅 I asked if it was enough with only a different
But then I do actually need a |
Looks like that because that's the only one that can provide the channelType we were talking about. |
Thanks, now it's clear. |
But you also need to register this in
I'll let @ejona86 answer that. It will be good if you can contribute a PR - since this functionality is sorely needed. |
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: NettyServerBuilder.forAddress(new DomainSocketAddress(path))
.channelType(EpollServerDomainSocketChannel.class)
... |
"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 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? Grpc.newServerBuilderForAddress("unix:/foo.bar", InsecureServerCredentials.create()) |
Okay I see what you are saying. But:
|
The design for #3085 is essentially add 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. |
@cfredri4 if you are interested in submitting a PR I can share my doc with you. Let me know |
I tried to use xDS with istio grpc-agent. But it doesn't work well.
Is your feature request related to a problem?
xDS doesn't work with istio grpc-agent because not supported NameResolver of
unix:///
#4750
Then I write a simple NameResolverProvider that it just returns DomainSocketAddress, but it doesn't work.
Describe the solution you'd like
Enable xDS to handle unix domain socket with istio grpc-agent like grpc-go.
Additional context
https://istio.io/latest/blog/2021/proxyless-grpc/
The text was updated successfully, but these errors were encountered: