Skip to content

Commit

Permalink
* Added DBeaver connection
Browse files Browse the repository at this point in the history
  • Loading branch information
alvinosh committed May 9, 2024
1 parent 1ea4583 commit 62b5400
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -799,9 +799,15 @@ Approach 1: (by ssh'ing directly in the k8s pod)

Approach 2: (by using external psql with port-forwarding; requires that PostgreSQL be installed on your host computer)
* 1\) Set up a port-forward from `localhost:[5120/5220]` to your k8s database pod. (see: [port-forwarding](#port-forwarding))
* 2\) Run: `npm start "db.psql_k8s [dm-local/dm-ovh]"`
* 1\) Set up a port-forward from `localhost:[5120/5220]` to your k8s database pod. (see: [port-forwarding](#port-forwarding))
* 3\) The shell should now have you logged in as the `admin` user.

Approach 3: (by using dbeaver)
* 1\) Set up a port-forward from `localhost:[5120/5220]` to your k8s database pod. (see: [port-forwarding](#port-forwarding))
* 2\) Retrieve the data from "debate-map-pguser-admin" for the "dm-local" context by running "npm start db.local_secrets"
* 3\) Enter the data printed in the console to make a new dbeaver connection.


</details>

<!----><a name="k8s-view-pg-config"></a>
Expand Down
9 changes: 9 additions & 0 deletions package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,15 @@ Object.assign(scripts, {
console.log("Connecting psql to database:", database);
const psqlProcess = StartPSQLInK8s(K8sContext_Arg(), database, {stdio: "inherit"}, pager);
}),
local_secrets: Dynamic(()=>{
// we only care about local context data here, so no need to pass context to GetK8sPGUserAdminSecretData
const secret = GetK8sPGUserAdminSecretData("dm-local");
console.log("--- Local Secrets ---");
console.log("PORT:", 5120);
console.log("DATABASE:", "debate-map");
console.log("USER:", "admin");
console.log("PASSWORD:", secret.GetField("password").toString());
}),

// db init/seed commands (using psql to run standard .sql files)
buildSeedDBScript: GetBuildSeedDBScriptCommand(),
Expand Down

0 comments on commit 62b5400

Please sign in to comment.