Sujeet Raman

Sujeet Raman

  • 741
  • 915
  • 335.2k

How to Connect to a PSQL database deployed in a Kubernetes cluster?

Jun 30 2023 8:02 AM

I have a local .NET Core application for a web API, and my PostgreSQL (psql) database is deployed in a Kubernetes cluster, specifically for my development environment. As per the requirements, I cannot install the database locally. Now, I need to test my API's POST code, which utilizes Entity Framework (EF), by checking if tables are created and data is saved in the database. I have obtained the connection string from the cluster, which is as follows:

Host=postgres-new-postgresql-helm.database-new.svc.cluster.local; Port=54000; Username=admin; Password=admin; Database=db; SearchPath=public;

I would like to connect to this database from my local machine and use pgAdmin4 to view the changes in the development cluster-deployed database. Specifically, I want to see the tables created and verify if the data is being saved correctly. Could you please guide me on how to establish a connection to this database using pgAdmin4 and visualize the changes made in the development cluster-deployed database? I would like to use the graphical user interface (GUI) provided by pgAdmin4 for this purpose.

Thank you in advance for your assistance.


Answers (4)