Skip to main content
Platform

DBeaver + kubectl β€” the local database cockpit

:::note Supersedes the in-cluster Adminer console (2026-11-21) The browser-based Adminer cockpit (an ArgoCD-deployed, SSO-gated pod with netpol reach into DB namespaces) was retired in favour of a local DBeaver CE client tunnelling over kubectl port-forward. Rationale: zero cluster footprint (nothing to attack/patch), access bounded by your own kubeconfig RBAC, one tool covering PostgreSQL + MariaDB + ClickHouse, and dev/prod visual guardrails (red + read-only on production) that Adminer could not provide. The operational counterpart to the auto-generated schema ERDs β€” tbls documents the schema in Git; DBeaver is the hands-on console to inspect/query/debug live data. Two different jobs. :::

What it is / isn't​

  • Is: a local desktop SQL client to browse tables, run read queries, analyse locks, trace a bug across every relational DB on the platform (~20 PostgreSQL, 3 MariaDB, 1 ClickHouse).
  • Isn't: a design canvas, and not how schema changes happen. Schema changes stay in migrations (Flyway/Alembic/golang-migrate/Drizzle) β†’ GitOps. DBeaver is read/inspect/operate.

How it's safe (the model)​

ControlImplementation
No cluster footprintDBeaver runs on your laptop. Nothing is deployed in k8s β€” the retired Adminer pod/ingress/netpols are gone.
Access = your RBACreach is only ever your own kubectl (OIDC context minicloud-oidc); there is no standing in-cluster service with broad DB reach.
ExposureDBs are ClusterIP-only. The sole path is a kubectl port-forward to localhost β€” never a public route.
Primary routingCNPG HA clusters are reached via the <cluster>-rw Service, which always follows the current primary across a failover (never a pod or the read-only -ro/-r service).
No secrets at rest in Gitthe connection file carries no passwords (save-password: false); credentials are pulled per-session from the k8s Secret into DBeaver's master-password store.
Prod guardrailevery production connection is tagged Connection type = Production (red header/tabs) + read-only by default β€” an explicit, deliberate toggle is needed to write.

Setup (one-time)​

brew install --cask dbeaver-community # macOS; CE covers PG / MariaDB / ClickHouse / SQLite

Helper scripts + the connection generator live in minicloud-ops/scripts/db/ (committed, reusable):

FilePurpose
db-targets.tsvsingle source of truth β€” one row per DB (local port Β· ns Β· service Β· engine Β· env Β· secret)
db-portforward.sh <ns> <svc> <localport> [remoteport]open ONE forward
db-forward-all.sh [filter]open every (or a filtered) forward at once; Ctrl-C tears them all down
gen-dbeaver-sources.pyemit a DBeaver-importable data-sources.json from db-targets.tsv (prod β†’ red + read-only)

Daily use​

# 1. open the tunnels (all, or filter to e.g. prod / ktayl):
cd ~/Developer/cloudplateform/minicloud-ops/scripts/db
./db-forward-all.sh # KCTX defaults to minicloud-oidc; on the controller use KCTX=default
# 2. (first time) import the connections into DBeaver:
./gen-dbeaver-sources.py > /tmp/dbeaver-data-sources.json
# DBeaver β†’ File β†’ Import β†’ DBeaver β†’ Project / connections β†’ pick the file; verify one dev + one prod.
# 3. connect; DBeaver dials localhost:<port> through the open forward.

Local-port map (from db-targets.tsv)​

PostgreSQL 554xx Β· MariaDB 533xx Β· ClickHouse 58123. Representative rows (prod = red + read-only):

PortNamespace / serviceEngineEnv
55438ktayl-core-prod / ktayl-core-cnpg-rwpostgresprod
55437ktayl-core / ktayl-core-cnpg-rwpostgresdev
55440ktayl-iam-prod / ktayl-iam-cnpg-rwpostgresprod
55445underwriting-prod / underwriting-postgres-rwpostgresprod
55444underwriting / underwriting-postgres-rwpostgresdev
55443retrieva / retrieva-cnpg-rwpostgresprod
55432authentik / authentik-cnpg-rwpostgresprod
53306erp / erpnext-mariadb-stsmariadbprod
53308itsm / glpi-mariadbmariadbprod
58123langfuse / langfuse-clickhouseclickhouseprod

The full set (23 connections) is in db-targets.tsv β€” the scripts and the generator all read it, so add or retune a DB in one place.

Pulling credentials per-session (never stored in Git)​

CNPG clusters put the app login in the <cluster>-app Secret (kubernetes.io/basic-auth: username / password / dbname):

NS=underwriting CL=underwriting-postgres # example (dev)
kubectl --context minicloud-oidc -n $NS get secret ${CL}-app \
-o jsonpath='{.data.username}{"\t"}{.data.dbname}' | xargs -0 -I{} sh -c 'echo {} | base64 -d' # user + db
kubectl --context minicloud-oidc -n $NS get secret ${CL}-app -o jsonpath='{.data.password}' | base64 -d; echo

Plain-StatefulSet / vendor DBs use an Opaque secret with varying keys β€” discover them with:

kubectl --context minicloud-oidc -n <ns> get secret <name> -o go-template='{{range $k,$v := .data}}{{$k}}{{"\n"}}{{end}}'

Paste the password into DBeaver on first connect (master-password store); it is never written to the file.

Where these credentials actually come from (Vault β†’ ESO vs CNPG operator-generated, and the storage discipline) β†’ Where database credentials live.

Companion tools (out of DBeaver CE scope)​

StoreTool
Redis / Valkey (~11)RedisInsight (free desktop) β€” port-forward the Redis service the same way
OpenSearch (yente)OpenSearch Dashboards (already web-based)
Qdrant (ai)Qdrant built-in web UI at :6333/dashboard (port-forward svc/qdrant)

Verify (run it β€” these are real results)​

# tunnel + credential + query path, end-to-end (what DBeaver does over JDBC):
cd ~/Developer/cloudplateform/minicloud-ops/scripts/db
KCTX=minicloud-oidc ./db-portforward.sh underwriting underwriting-postgres-rw 55444 5432 &
# β†’ nc -z localhost 55444 β†’ "localhost:55444 OPEN"
# β†’ psql -h localhost -p 55444 -U underwriting -d underwriting -tAc 'select 1,current_database(), …'
# β†’ SELECT_OK|underwriting|200 (200 tables; creds pulled from underwriting-postgres-app)

For the full inventory of databases this cockpit covers, see the schema ERD index.