Skip to main content
The PGAdmin custom resource deploys a standalone pgAdmin 4 web interface for managing PostgreSQL clusters. Unlike the embedded pgAdmin available via spec.userInterface.pgAdmin in a PostgresCluster, the standalone PGAdmin resource can connect to multiple clusters simultaneously — either by name or by label selector — making it the preferred choice for teams managing several clusters in a namespace. API group: postgres-operator.crunchydata.com/v1beta1 Kind: PGAdmin Scope: Namespaced

Connecting pgAdmin to a PostgresCluster

The spec.serverGroups field controls which PostgresCluster resources appear in pgAdmin. You can reference clusters by name or dynamically select them by label.
Exactly one of postgresClusterName or postgresClusterSelector is required per server group. An empty postgresClusterSelector ({}) selects all clusters in the namespace.
PGO automatically registers the selected clusters as server connections in pgAdmin, using connection credentials from the cluster’s secrets. You do not need to configure server connections manually in the pgAdmin UI.

Example


Spec fields

VolumeClaimSpec
required
PersistentVolumeClaim definition for pgAdmin’s data directory. Must include at least one accessMode and a storage request.
[]ServerGroup
Groups of PostgresCluster resources to import into pgAdmin. Leave this field empty to create a pgAdmin instance with no auto-discovered servers. PostgresClusters can still be added manually through the pgAdmin UI.
[]PGAdminUser
pgAdmin users managed declaratively through the PGAdmin spec. Users added through the pgAdmin web UI are not reflected here. Uses username as the list map key (must be unique).
StandalonePGAdminConfiguration
Configuration settings for the pgAdmin process. Changes are applied without validation — an invalid configuration may leave pgAdmin in an unusable state.
string
Container image for pgAdmin 4. When omitted, the operator uses the RELATED_IMAGE_PGADMIN environment variable.
string
Image pull policy for the pgAdmin container. One of: Always, Never, IfNotPresent.
[]LocalObjectReference
Image pull secrets for pulling the pgAdmin image from a private registry. Changing this value causes all running pgAdmin pods to restart.
ResourceRequirements
Compute resource requests and limits for the pgAdmin container.
Affinity
Kubernetes affinity rules for scheduling the pgAdmin pod.
[]Toleration
Tolerations for scheduling the pgAdmin pod onto tainted nodes.
string
Priority class name for the pgAdmin pod. Changing this value causes the pod to restart.
string
Name to use for the ClusterIP Service pointing to the pgAdmin pod. If a Service with this name already exists, PGO updates it. When omitted, the service is named after the PGAdmin resource.
PGAdminVolumesSpec
Additional volumes to add to the pgAdmin pod.
InstrumentationSpec
Configuration for the OpenTelemetry collector container used to collect logs and metrics from the pgAdmin pod.
Metadata
Labels and annotations to apply to all resources created for this pgAdmin instance.

Status fields


Accessing pgAdmin

By default, the pgAdmin service is a ClusterIP Service. To access it from outside the cluster, use kubectl port-forward:
Then open http://localhost:5050 in your browser. For external access, configure the spec.serviceName and a LoadBalancer or NodePort service using an ingress controller, or expose the service directly. See the Kubernetes services documentation for details.
The pgAdmin web UI default port is 5050. The PGAdmin service exposes this port by default. If you change the port via config.settings, you must also update your Service configuration accordingly.

Embedded vs. standalone pgAdmin

PGO supports two ways to run pgAdmin: