I have to implement readiness probe for every service in my spring boot app.
Every of my services in application expose liveness and readiness endpoints.
Some of my services depends on others.
The question is: How to check service A in readiness of service B?
Write ServiceAHealthIndicator class, that will request service A liveness endpoint. And then include this health indicator in application.yml by property menagment.endpoint.health.group.readiness.include=ServiceA
In Kubernetes configuration add endpoint serviceA/liveness to readiness. Maybe something like:
readinessProbe:
httpGet:
path: serviceA/health/liveness
port: 8000