Create a HealthCheck to a non-api project for liveness probe openshift

Viewed 505

I have a project that just consumes messages from Rabbit MQ, and I'm using Net Core 2.1.. I just create a "Console Application" with hosted service and everything is working fine.

Now I need to deploy it to Openshift and configure Liveness Probe, So I have 2 options:

  1. Create an API in my application to respond when /health URL is called. Remember that I don't have ASP.NET Core dependencies in my project, I will need to add a lot of dependencies just because of /health URL. Anti-Pattern maybe ??

  2. Make Liveness Probe execute a command inside my POD (like ps -eaf) to check if my application is running. I really think this can return a "false-positive" and not very accurate like /health.

So, what is the best solution and most used for a worker using Openshift Liveness Probe ?

1 Answers

A light weight option compared to kestrel is HttpListener if its simply for a health check

Related