This is most like a kestrel question related on how it works in kubernetes.
So we have a react + dotnet application Working created. BE + Reat for serving static content.
We created dockerfile expoing port 5007.
Applications works fine locally, and also after deploying into kubernetes, if you portforward locally to container port 5007 is also working. You are getting the UI in your web browser.
the problem is that if you connect from a sample pod and you hit the service created for this react app like:
curl http://10.1.2.5:5007
I´m getting:
curl: (52) Empty reply from server
service has coorrectly configured:
- port: 80
protocol: TCP
targetPort: 5007
and If I run the same locally inside container pod:
curl http://localhost:5007
I´m getting same Empty reploy from server
.
The port if listening correctly if I do inside container a :
netstat -tlnp
I see that por is listening.
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 :::5007 :::* LISTEN 1/dotnet
So question is….why I´m getting that error and how you basically configure kestrel to run in kubernetes?
we are planning o use an nginx IC for handling traffic but firstly I need to understand what needs to be configured from kestrel correctly, otherwise nginx is also going to get the empty response.
According to this doc, port 5007 is ok as ports used in kestrel:
New ASP.NET Core projects are configured to bind to a random HTTP port between 5000-5300
3