I will give a step-by-step approach to solving this problem.
1. You have a gRPC server. Make sure it is running on the "0.0.0.0:PORT" 
socket. And, make a cluster IP service to this gRPC pod. Assume we named it 
"grpc_service".
[image: Screenshot 2023-02-06 at 4.06.22 PM.png]
2. Assume you have Node JS (REST API - CLIENT) listening on the Kubernetes 
service of your gRPC. ``config.OG_GRPC_SERVER = "grpc_service:PORT"
[image: Screenshot 2023-02-06 at 4.08.12 PM.png]

If you do this, you will not need the 
"<serviceName>.<namespace>.svc.cluster.local:80" connection URL. I can you 
are facing an issue with connection in client.
On Monday, 6 February, 2023 at 3:43:30 pm UTC+5:30 Keyur Patel wrote:

> I am using this on the client side: 
> "<serviceName>.<namespace>.svc.cluster.local:80". 
>
> On Monday, February 6, 2023 at 3:41:28 PM UTC+5:30 Sharan Karthikeyan 
> wrote:
>
>> Make sure gRPC server running on 0.0.0.0:PORT, so you have to make the 
>> connection to that socket from your client side. If you are using 
>> localhost:PORT in client side, it is pointing to the current pod's (client 
>> side - local machine) socket, hence you need change 0.0.0.0:PORT in both 
>> gRPC side (server) as well as your client side (Node or Apache or Go or 
>> etc).
>>
>>
>> On Monday, 6 February, 2023 at 3:37:06 pm UTC+5:30 Sharan Karthikeyan 
>> wrote:
>>
>>> Can you please share your client listening port and IP address?
>>> If you are using 127.0.0.1 (localhost), then change it to 0.0.0.0:PORT
>>> On Monday, 6 February, 2023 at 3:09:43 pm UTC+5:30 keyu...@gmail.com 
>>> wrote:
>>>
>>>> Hi @sharan,
>>>> Can you share your yaml files example? I am facing the same issue.
>>>>
>>>> On Monday, January 30, 2023 at 10:07:40 PM UTC+5:30 Sharan Karthikeyan 
>>>> wrote:
>>>>
>>>>> Actually, I found the answer. I have used the localhost socket in the 
>>>>> gRPC server, I changed it 0.0.0.0:PORT, and then it worked.
>>>>> Thank you for the response.
>>>>>
>>>>> On Friday, 20 January, 2023 at 4:21:39 am UTC+5:30 rbel...@google.com 
>>>>> wrote:
>>>>>
>>>>>> Can you please provide more context? Your headless service should 
>>>>>> create a DNS entry in kubedns as you've described and the kubernetes 
>>>>>> NodeJS 
>>>>>> client should be able to resolve that DNS entry. Exactly what is the 
>>>>>> issue 
>>>>>> you are experiencing? 
>>>>>>
>>>>>> On Sunday, January 15, 2023 at 9:21:44 PM UTC-8 Sharan Karthikeyan 
>>>>>> wrote:
>>>>>>
>>>>>>> I have created a headless service in kubernetes for gRPC server. 
>>>>>>> But, I'm not able to connect that server in NodeJS client the 
>>>>>>> connection 
>>>>>>> url like this "bbl-org-server.default.svc.cluster.local" -- 
>>>>>>> "<serviceName>.<namespace>.svc.cluster.local". Please help me.
>>>>>>>
>>>>>>> Regards,
>>>>>>> Sharan
>>>>>>>
>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/4d335a4d-ccf1-4415-bdf7-80e29923ffd7n%40googlegroups.com.

Reply via email to