Deploying Pgcli in Kubernetes with a Helm Chart

The pods were spinning up, but your database CLI was missing. Pgcli with a Helm chart fixes that in seconds. Fast deployments, no manual config, no wasted motion.

Pgcli is a popular command-line client for PostgreSQL with auto-completion and syntax highlighting. Running it inside Kubernetes lets you query and manage your database without leaving the cluster. A Helm chart makes the deployment repeatable, versioned, and portable.

Step 1: Prepare Kubernetes and Helm
You need a running Kubernetes cluster and Helm installed locally. Ensure kubectl can connect to your cluster and you have the right namespace ready.

Step 2: Create a Helm Chart for Pgcli
Define your Chart.yaml with metadata for the Pgcli service. In values.yaml, set container image references, resource limits, and environment variables for database credentials. Avoid hardcoding secrets; use Kubernetes Secrets and reference them in your chart.

Step 3: Write the Deployment Template
In templates/deployment.yaml, create a Deployment resource that runs the Pgcli container. Mount configuration files if needed. Use ConfigMaps for query scripts or CLI settings.

Step 4: Service and Access
If Pgcli needs to connect to a database outside the cluster, configure network policies and service endpoints. For in-cluster databases, use their service names as the host.

Step 5: Install with Helm
Run:

helm install pgcli ./pgcli-chart

Helm will render templates with your values and push them to Kubernetes. Upgrades are simple: change values and run helm upgrade.

Benefits of Pgcli Helm Chart Deployment

  • Automated setup of Pgcli inside Kubernetes
  • Consistent configuration across environments
  • Easy rollback and version management with Helm
  • Secure handling of credentials using Secrets

With this approach, developers and ops teams can query PostgreSQL instantly inside the cluster environment. No manual pod exec, no ad-hoc containers.

Deploy Pgcli with a Helm chart now and take full control of your database workflows. Visit hoop.dev to see it live in minutes.