ProjectLibertyLabs / social-app-template

Social Application Template that uses Gateway Services
Apache License 2.0
1 stars 4 forks source link

Implement Health Controller for endpoints: healthz, livez, and readyz #100

Open mattheworris opened 4 months ago

mattheworris commented 4 months ago

As a developer, I want the social-app-template-backend to have a HealthController that can be queried for health, livez, and readyz. The HealthController should check that all micro-services are available before making the backend state ready.

Discussion

At startup, social-app-template-backend should check each micro-service readyz endpoint in a while loop that will wait forever, if a micro-service is not available. Once this check is completed, the backend can enable the readyz endpoint.

Reasoning:

Availability of the content-watcher (or other micro-services) is not an internal application error, and likely will not be fixed by the service being restarted.

Why /readyz instead of /livez? Same as above--/livez failure would cause K8s to restart the pod; this likely won't help the situation. But /readyz failure should prevent us from routing traffic to the pod until it is fully up.

Acceptance Criteria