Resolved

Need web-based PostgreSQL schema inspection in Kubernetes cluster

PostgreSQL
Database
Kubernetes
k3s
DevOps
CloudBeaver
Schema Inspection
Debugging

Deploying CloudBeaver in k3s for visual database inspection without local software | Includes port-forwarding, connection setup, and schema verification queries

Issue

Developers required visual inspection of PostgreSQL schema changes, including new TIMESTAMP columns, indexes, and complex rating calculations, but encountered limitations due to:

  • Lack of local database GUI tools in their development environment.
  • No direct access to the PostgreSQL instance running in the Kubernetes cluster.
  • Inability to verify schema migrations, such as OVERLAPS operator usage and index creation, before deployment.

Culprit

Three technical constraints prevented traditional inspection methods:

  • Cluster Isolation: PostgreSQL was only accessible internally within the cluster, blocking external tool connections.
  • Tooling Gap: No web-based database GUI was deployed in the Kubernetes environment.
  • Ephemeral Needs: Temporary inspection needs made deploying permanent tooling impractical.

Standard approaches, such as local tools (e.g., DBeaver) or direct port-forwarding, were ineffective due to security risks and the lack of visual schema inspection capabilities in CLI tools.

Solution

Deployment

CloudBeaver was deployed as a Kubernetes Deployment with resource limits (e.g., 512Mi memory, 250m CPU) to enable browser-based PostgreSQL schema inspection.

Secure Access

Access to CloudBeaver was granted via port-forwarding to localhost:8978, allowing internal PostgreSQL connections through Kubernetes DNS. Credentials were securely retrieved from Kubernetes secrets.

Schema Verification

Specialized SQL queries were executed to validate schema changes:

  • Verification of TIMESTAMP columns and their data types.
  • Testing of the OVERLAPS operator for overlapping bookings.
  • Validation of newly created indexes.

Ephemeral Design

The solution was designed for temporary use:

  • No persistent storage was configured.
  • Cleanup commands were provided to remove the deployment and service post-use.
  • Resource limits prevented cluster contention.

Result: The team gained full schema inspection capabilities, including visual table/ER diagram generation, query execution, and secure access to live data without requiring local tooling.