Update readiness/liveness probes for postgres containers to use local socket
Created by: caugustus-sourcegraph
Using hostname
in the psql command involves a DNS lookup and traffic exiting the container. This is outside the scope of a readiness probe and introduces new dependencies that are unrelated to the postgres container. DNS lookup failures should not cause Postgres to restart.
Another potential improvement here is to replace the psql
command on L24 with pg_isready
(docs). I don't have enough context on why we chose to use psql, so I wanted to err on the side of minimal change first.