psql is the PostgreSQL interactive command-line client for executing SQL statements and administrative commands. In Kubernetes, it can test database connectivity without modifying the application. section 8.4.3
A practical Kubernetes testing workflow uses psql to:
- Provision a temporary, deletable Pod directly with kubectl. section 8.4.3
- Start from the small debian:bullseye-slim image and keep its container running with sleep infinity. section 8.4.3
- Install the PostgreSQL client inside the Pod, then run psql to connect to the database from within the cluster. section 8.4.3
Testing from a temporary Pod
When no existing container includes psql, create a disposable Pod instead of building a new image. This supports quick tests of container-to-container communication, ConfigMaps, Secrets, and database connectivity; delete the Pod afterward. section 8.4.3
Figure 8.14 Cross-service communication between Services and psql
Trace how Services expose database endpoints that psql can use for cross-service communication. section 8.4.3


