Liveness / Readiness probe failed after upgrade to .Net Core 3.1 Liveness / Readiness probe failed after upgrade to .Net Core 3.1 kubernetes kubernetes

Liveness / Readiness probe failed after upgrade to .Net Core 3.1


The issue was that kestrel server for .NET Core 3.1 was pointing to localhost instead of 0.0.0.0. Hence, wasn't accessible from outside. Which is why liveness and readiness probes were failing.

To change url from localhost to 0.0.0.0 I needed to add below section in appsettings.json:

"Kestrel": {    "EndPoints": {      "Http": {        "Url": "http://0.0.0.0:5000"      }    }  }

Note: UseUrl() method or setting environment variable ASPNETCORE_URLS doesn't work for .NET Core 3.1.