<p>Consul has a TTL health check which status should be updated periodically over the HTTP interface.
From akka.net microservices we were performing the GET request to the registered Consul Service endpoints to reset the TTL timer and staying life at Consul Service dashboard.</p>

<p>Does Kubernetes have something similar to it? Not the liveness/readiness probe that performing requests to <code>pod_ip:port</code>, but waiting for the request from the running app.
For example, we want to monitor not just that AKKA app running on some port, but to make sure that each actor in the actor system is healthy.</p>

<p>Thanks!</p>

Artur  Cherniak
<p>Kubernetes wants to probe the application (with liveness and readiness probes), while the application wants to send its TTL heartbeats to signal liveness to, say, a Consul agent.</p>

<p>One way to reconcile both health check strategies could be a special <a href="https://ahmet.im/blog/advanced-kubernetes-health-checks/" rel="nofollow noreferrer">sidecar health check server</a> running inside the app's pod. Such a sidecar server would sit between the app and the kubelet, and would handle the TTL heartbeats of the app to update its internal state, noting if the app is still alive. As long as that is the case, it would reply with a 200 OK to the <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-a-liveness-http-request" rel="nofollow noreferrer">HTTP probes of Kubernetes</a>. Else it would reply with a code outside the 200-300 range to Kubernetes to signal that the app is unhealthy.</p>

<p>The Consul agent itself could serve as part of such a sidecar health-check server. Its <a href="https://www.consul.io/api/health.html" rel="nofollow noreferrer">HTTP health check API</a> returns the status of the app's TTL-liveness as a JSON object. All that needs to be done is to translate the status into an appropriate HTTP return code. But using Consul agent is totally optional: a sidecar could of course handle the TTL heartbeats itself.</p>
