Unable to connect to PostgreSQL in a separate Kubernetes pod using Diesel in Rust #120
Replies: 1 comment 2 replies
-
Thanks for opening this issue. Now to the actual problem: Technically speaking your title is incorrect, as |
Beta Was this translation helpful? Give feedback.
-
Setup
We have a rust server needs to connect to a postgres database. Locally this works when using docker-compose without issue. In testing environment, we are using kubernetes with the postgres database in its own pod.
(The production environment which we have not pushed to yet has the postgres db in RDS on AWS. As it is not working in the test server, we have not pushed to this yet obv!)
Versions and Feature Flags
Problem Description
We have just swapped a python server to rust on a kubernetes cluster in a testing environment. The rust server uses diesel, diesel-async and deadpool to connect to the postgres database. This works locally when we are using docker-compose to spin up the database and everything can be connected locally. This also work in CI and passes all integrations tests.
The issue is when the server is deployed into a kubernetes cluster. The database is a pod in the cluster in namespace database, and the server is in production.
This is the code that runs the connection:
What are you trying to accomplish?
Connect the server to the database.
What is the expected output?
Connection to the database
What is the actual output?
The error is:
Are you seeing any additional errors?
No but I have done the following:
Beta Was this translation helpful? Give feedback.
All reactions