Closed alesj closed 1 year ago
Modifying things a bit ... trying to push in the right IP, instead of 0.0.0.0 or localhost ... but still no success. e.g.
try (InputStream stream = getClass().getClassLoader().getResourceAsStream("bootstrap.json")) {
byte[] xdsBytes = stream.readAllBytes();
String xdsConfig = new String(xdsBytes);
String ip = InetAddress.getLocalHost().getHostAddress();
log.info("Current IP: {}", ip);
xdsConfig = xdsConfig.replace("${ip}", ip);
System.setProperty("io.grpc.xds.bootstrapConfig", xdsConfig);
}
How is the xds management server configured on LDS resource information?
It looks xDS server is reaching Istio, but no resource is returned. The UNAVAILABLE
error code is due to (~15s) timeout when xds client does not receive any response and retried the stream towards istio. So it notified onAbsent.
@YifeiZhuang all I do is run that ./bin/istioctl install --set profile=minimal
which should setup Istio in K8s (Minikube in my case). Afaiwt that should also setup xDS ... Dunno if that's enough?
@luksa ^ any thoughts? :-)
@alesj we recently added support for Istio with grpc-java. Istio + proxyless-gRPC is described in this blog https://istio.io/latest/blog/2021/proxyless-grpc/ . Although the blog covers an example with grpc-go the same concepts apply to Java. Things to note:
There is dependency on the XdsClient supporting communication over UDS with Istio's xDS proxy. This was recently added to Java but is yet to be tested with Istio.
For server side especially make sure you follow the instructions in the blog so the appropriate Listener is returned to the server. Please let us know what you find.
@sanjaypujare yeah, saw that blog before, and the examples/example-cds. But what I was missing is an example of bootstrap.json that should be used.
Do I really need to follow all those k8s steps?
Or why isn't ./bin/istioctl install --set profile=minimal
+ my app k8s deployment enough?
(or what I might be missing on the Istio side / deployment?)
Do I also need to change how my proto service is built?
But what I was missing is an example of bootstrap.json that should be used.
e.g. I had to check Istio code to see how the node's id should look like -- 4 parts split with ~
Istio log after the "server" app tries to connect:
OK, typo in port name ... now:
Skywalker:quarkus alesj$ kubectl get endpoints qcl-app -n istio-system NAME ENDPOINTS AGE qcl-app 172.17.0.4:30051 5d23h
But still I get this ...
2022-10-26T07:59:46.599064Z info ads Incremental push, service qcl-app.istio-system.svc.cluster.local at shard Kubernetes/Kubernetes has no endpoints 2022-10-26T07:59:46.747565Z info ads Push debounce stable[7] 3 for config ServiceEntry/istio-system/qcl-app.istio-system.svc.cluster.local: 135.307083ms since last change, 148.409042ms since last push, full=false 2022-10-26T07:59:46.747715Z info ads XDS: Incremental Pushing:2022-10-26T07:07:49Z/2 ConnectedEndpoints:0 Version:2022-10-26T07:07:49Z/2 2022-10-26T07:59:48.756881Z info ads Push debounce stable[8] 3 for config ServiceEntry/istio-system/qcl-app.istio-system.svc.cluster.local: 101.014209ms since last change, 138.915417ms since last push, full=false 2022-10-26T07:59:48.756985Z info ads XDS: Incremental Pushing:2022-10-26T07:07:49Z/2 ConnectedEndpoints:0 Version:2022-10-26T07:07:49Z/2
Finally progress ... Was missing "injection":
Now it all starts as it should:
2022-10-28 11:11:54,246 FINER [io.grp.xds.XdsLogger] (grpc-default-executor-0) [xds-client<10>: (unix:///etc/istio/proxy/XDS)] Sending ACK for LDS update, nonce: zd+Nre/rvXw=30965a49-3ec0-4b4e-9ee1-ccedf272bd7c, current version: 2022-10-27T12:47:09Z/4 2022-10-28 11:11:54,364 FINER [io.grp.xds.XdsServerWrapper] (grpc-default-executor-0) Delegate server started. 2022-10-28 11:11:54,386 INFO [com.ale.qcl.app.Configuration] (xDS Server) Listening on port 30051
And the bootstrap.json is referenced / magically added via:
Environment: GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT: true GRPC_XDS_BOOTSTRAP: /etc/istio/proxy/grpc-bootstrap.json
Now it all starts as it should:
Great! Does it work end to end as expected? Do you have both client and server configured as proxyless so using the Istio bootstrap file? Would it be possible to see your code and config somewhere? Thx
Finally got it working on both ends -- the client side then was easy, just had to code it and properly direct it to the target / server.
The code is here (as mentioned in the initial description)
It has some Quarkus magic: DI, Docker image build (via JIB), etc
Main code - single class :-)
My k8s resources:
And this is how it looks when Quarkus does all the magic behind the scene :-)
Instead of plain gRPC server Quarkus creates XDS based wrapper / server. And all the stubs get XDS channel.
# XDS
quarkus.grpc.server.xds.enabled=true
quarkus.grpc.server.port=30051
quarkus.grpc.clients.stub.name-resolver=xds
quarkus.grpc.clients.stub.host=qcl-app
quarkus.grpc.clients.stub.port=30051
If there is no issue, can we close this issue?
I'm trying to get
examples/example-xds
to work.I'm using Istio as XDS management server:
This is my PoC app (copied the example's code)
I then build a Docker image out of this PoC app
And deploy it into the same namespace as Istio
kubectl apply -f k8s/qcl-app-deployment.yaml -n istio-system
My app then gets stuck on this log msg
2022-10-20 08:37:38,430 WARNING [io.grp.xds.XdsServerBuilder$DefaultListener] (grpc-timer-0) [port:30051] UNAVAILABLE: Listener grpc/server=xds.resource.listening_address=0.0.0.0:30051 unavailable
The 'gRPC server' started (in the log) is another Quarkus gRPC server instance, which shouldn't be an issue. (I'm using Quarkus's gRPC support to simplify some of the stuff)
Afaics my xDS server can reach Istio, but not the other way around, right? Or what is that WARNING trying to tell me?
My
node
inbootstrap.json
looks like this:as I had to work around the error of not having 4 part, etc ...
Could this be an issue?