Database Access
Connect to bundled PostgreSQL for debugging and backups.
Direct database access is useful for debugging, backups, and inspecting state. Avoid running ad-hoc queries in production.
Bundled PostgreSQL credentials
| Field | Value |
|---|---|
| Username | vault |
| Password | vault |
| Database | vault |
| Port | 5432 |
| Service name | dev-sdk-postgresql |
Connecting via port-forward
bash · terminal
1kubectl port-forward svc/dev-sdk-postgresql 5432:54322# Custom namespace:3kubectl port-forward svc/dev-sdk-postgresql 5432:5432 -n <namespace>4# Connect client to localhost:5432 with vault/vault
Retrieving a customized password
bash · terminal
1# Default namespace:2kubectl get secret dev-sdk-postgresql -o jsonpath='{.data.password}' | base64 -d34# Custom namespace:5kubectl get secret dev-sdk-postgresql -n <namespace> -o jsonpath='{.data.password}' | base64 -d
Backup and restore
bash · terminal
1kubectl exec dev-sdk-postgresql-0 -- pg_dump -U vault -d vault > backup.sql2kubectl exec -i dev-sdk-postgresql-0 -- psql -U vault -d vault < backup.sql