Zaid-Ajaj / Fable.Remoting

Type-safe communication layer (RPC-style) for F# featuring Fable and .NET Apps
https://zaid-ajaj.github.io/Fable.Remoting/
MIT License
272 stars 54 forks source link

Fable.Remoting and kubernetes results in 404 #253

Closed runefs closed 3 years ago

runefs commented 3 years ago

I have a docker container with the Giraffe example running inside it. The container is deployed in a kubernetes pod. If I request it from another pod in the cluster or if I forward the container port to localhost and request it I get Api 404. However if I run the same application locally it works as expected

Zaid-Ajaj commented 3 years ago

Hi there @runefs, I am not familiar with kubernetes so I am not sure how to debug this. Can you please confirm that this indeed a Fable.Remoting issue? For example, if you have a normal Giraffe route next to the handler of remoting, can you still reach it?

runefs commented 3 years ago

Of that I am positive. I stubbled upon this in the process of rewriting a REST API to use Fable.Remoting instead. Could it have something to do with the bind address being different than the requested? Ie the bund address is 0,0,0,0:8085 but is accessed through http://kubernetes-service-name:8085. This does work for giraffe in general

Den 8. jun. 2021 kl. 23.12 skrev Zaid Ajaj @.***>:

 Hi there @runefs, I am not familiar with kubernetes so I am not sure how to debug this. Can you please confirm that this indeed a Fable.Remoting issue? For example, if you have a normal Giraffe route next to the handler of remoting, can you still reach it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

Zaid-Ajaj commented 3 years ago

This does work for giraffe in general

Fable.Remoting creates Giraffe handlers so I would assume it works here too.

That said, if you could provide a sample to reproduce the problem, that would be great! I can try to spin up local kubernetes thingy and see what going on. (never that before though, so that might take a bit)

runefs commented 3 years ago

It took me forever to recreate a small sample to reproduce the problem. There was however a straightforward reason for why it took so long. There's no issue. I had inadvertently changed the binding address from 0.0.0.0 to localhost (copy-paste of example code I guess). binding to localhost doesn't work in a container. However, when I tried to run it locally it did of course work and I must have tested the regular REST API before making that change