pulibrary / princeton_ansible

Ansible Roles and Playbooks for Princeton University Library
10 stars 4 forks source link

[allsearch-api] Use health.json for health checks #5114

Closed kayiwa closed 2 months ago

kayiwa commented 3 months ago

What maintenance needs to be done?

When allsearch-api's health checks are failing (health.json), it should not serve that application to the public.

Level of urgency

Why is this maintenance needed?

This will make it easier and safer to deploy to only some of the machines, because we won't have to adjust the nginx configuration to take things off the load balancer just in case it breaks.

Acceptance criteria

Implementation notes, if any

Nginx Documentation: https://docs.nginx.com/nginx/admin-guide/load-balancer/http-health-check/ Existing health check configuration: https://github.com/pulibrary/princeton_ansible/blob/main/roles/nginxplus/files/conf/http/imagecat_staging.conf#L35

First Step

Add the health check URL to the staging configuration.

rladdusaw commented 2 months ago

We decided to use /health.json to future proof further additions to the health check. It returns 200 if everything is running and an error if any of the services are down.