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
No healthy upstream with service mesh and namespace #2628
Comments
Are you using
|
@murgatroid99 I work with @sudheerit . Let me answer your questions.
When I include the namespace along with the hostname for istio: hostname/namespace
Note: Output of the client:
|
You are not required to use I don't think this is a problem in grpc-js itself. It just looks up whatever DNS name you give it, so you have to look elsewhere to determine why that DNS lookup is failing in your environment. As far as I know, a valid DNS name cannot contain a |
@murgatroid99 The issue here seems to be that like the grpc-js library doesn’t have an option to take namespace as an option while making the call. The above stack trace is when i provided the DNS with hostname/namespace instead of just hostname. When I provide just the hostname while creating the client, it results in the below error like you suggested
Can you please let us know how how do we make changes in the client to make a successful grpc when a namespace is involved. |
A namespace is an Istio concept. I suggest referring to Istio's documentation for information about how to use namespaces. I think that error also comes from Istio. |
@murgatroid99 I am confused here on why this is an istio concept. If i am hitting the same service from another client like postman, it worked as expected. It should work with a nodejs grpc client as well right? https://hostname/protopath/service |
In gRPC, when you construct a client, you provide it with only the hostname. It resolves that hostname to an IP address using DNS (or another name resolution protocol), and then makes requests to that server with the path In the URL https://hostname/namespace/protopath/service, only Based on the information I have here, I would conclude that Istio namespaces are not compatible with gRPC at all. However, I am also aware that Istio is generally compatible with gRPC. So, I would recommend checking the Istio documentation about namespaces and/or gRPC to see whether they specify how to make them compatible. For example, they might instruct you to specify the namespace in a specific gRPC metadata key. |
Problem description
Node js grpc call is returning no healthy upstream when the services are configured behind service mesh with namespace.
Reproduction steps
The gRPC services are developed in GoLang, and deployed in Kubernetes cluster in multiple namespaces. These services are accessed through service mesh, redirecting to the respective namespace based on URL.
Example: service-mesh-host/namespace
Node js is failing to connect with no healthy upstream issue. Postman and other tools were able to connect without any issue.
Node js is working when single namespace is there, we could able to route without namespace in URL and hardcoded namespace inside service mesh route.
Environment
The text was updated successfully, but these errors were encountered: