asynchronouskubernetesmicroservicesevent-drivenhealth-check

How should I healthcheck an event-driven service


Suppose I have a service which rather than listening for http request, or gRPC procedure calls only consumes messages from a broker (Kafka, rabbitMQ, Google Pub/Sub, what have you). How should I go about healthchecking the service (eg. k8s liveness and readyness probes) ?

Should the service also listen for http solely for the purpose of healthchecking or is there some other technique which can be used ?


Solution

  • Having the service listen to HTTP solely to expose a liveness/readiness check (although in services that pull input from a message broker, readiness isn't necessarily something that a container scheduler like k8s would be concerned with) isn't really a problem (and it also opens up the potential to expose diagnostic and control endpoints).