We're in the process of moving everything to K8s and one of our applications is a small .NET Core 2.2 console app that runs a Hangfire background job server. At the moment the app runs as a Windows service, but that's obviously about to change.
The problem that I ran into is that I'm not sure which approach is better for the K8s liveness probe:
- Use an ASP.NET Core web app and use the built-in health check system
- Stick to the console app approach and run some script to check the app still works
The only things that I think we need to check is if the process is up and if the app can connect to the Hangfire db. Doing this with the first approach is extremely easy, but I'm not sure it's worth creating a web app just for this. The second approach would result in a lighter app, but I honestly have no idea how we would end up checking the db connection.
Has anyone tackled this issue before? Is there some other approach that would be more appropiate? Any suggestion is appreciated.