Overview
pgvector adds avector column type and approximate nearest-neighbor indexes to PostgreSQL, so embeddings live in the same database as the relational data they describe. This template deploys one PostgreSQL 19 server with pgvector 0.8.7 on a persistent volume, an optional PgBouncer connection pooler in front of it, and an optional cron job that writes compressed pg_dumpall backups to AWS S3, Google Cloud Storage or a MinIO (S3-compatible) bucket.
The extension is not just installed in the image — the template creates it on first boot, in the database named in your credentials secret. A fresh install can store vectors and run similarity queries with no setup SQL.
Database credentials are not template values. The server reads its username, password and database name from a dictionary secret you create before installing, so no password passes through Helm or lands in the release. The template creates no credential secret of its own.
What Gets Created
Prerequisites
One secret must exist before you install. It holds the credentials your applications put in their connection strings. Secrets are org-level, so no GVC flag is involved.Create the database credentials secret
username, password and database. PostgreSQL creates that user (as a superuser) and that database the first time the volume is initialized, and the template creates the vector extension inside it:config.credentialsSecretName to this name. Read it back later with cpln secret reveal SECRET_NAME -o yaml — a bare cpln secret reveal prints only a summary table, not the values.accessKey and secretKey. Nothing else is required for a default install.
Installation
Install the chart from the marketplace registry, pointing it at the secret you created:UI
CLI
Terraform
Pulumi
Configuration
Each block below is the shipped default for that part ofvalues.yaml.
Server and Resources
maxCpu to minCpu may not exceed 4:1. Raising maxCpu without raising minCpu can cross that limit and is rejected when the workload is applied.Credentials and Extensions
config.extraExtensions lists additional extensions to create alongside vector at first boot, such as pg_trgm, pgcrypto or btree_gin. Each entry must be an extension the image already ships and must match ^[a-z][a-z0-9_]*$; anything else is refused when the chart renders. The vector extension is always created and does not need to be listed.
Storage
Internal Access
internalAccess can take several minutes to take effect — re-test before concluding it did not apply.
Public Access
status.canonicalEndpoint:
PgBouncer
PgBouncer multiplexes many application connections into a small pool of real database connections — the bursty, short-lived connections typical of retrieval and embedding services. When enabled it becomes the endpoint your applications connect to, and it reads the same credentials secret and identity as the server — nothing extra to configure.Backup
A cron workload runspg_dumpall on the schedule and uploads a gzip-compressed SQL dump of every database and role to the bucket for the chosen provider. It authenticates with the username and password from your credentials secret. Each provider’s bucket, cloud account and policy steps are under Backing Up.
Connecting
Everything below is reachable from inside the GVC, subject tointernalAccess.type; the public path exists only when publicAccess.enabled: true.
psql inside the container, where the credentials are already present as environment variables:
Using pgvector
Thevector extension is already created in the database named in your credentials secret, so there is no setup SQL to run:
maintenance_work_mem, for example SET maintenance_work_mem = '512MB'; within the resources.maxMemory you have given the server.
With PgBouncer in transaction mode, set these per query inside a transaction so the setting cannot leak to another client:
vector column holds up to 16,000 dimensions but can only be indexed up to 2,000 — 1,536-dimension embeddings index fine, while 3,072-dimension ones are rejected with column cannot have more than 2000 dimensions for hnsw index. Use halfvec, which indexes up to 4,000 dimensions, or reduce the dimensionality.
Operations
Backing Up
Backups are off by default. Enable them withbackup.enabled: true, pick a backup.provider, and complete that provider’s setup below first. The job writes postgres-TIMESTAMP.sql.gz objects under backup.PROVIDER.prefix in your bucket on every run of backup.schedule.
Backup Prerequisites
Complete the steps for your provider before enabling backups.AWS S3
-
Create an S3 bucket. Set
backup.aws.bucketto its name andbackup.aws.regionto its region. -
If you do not have one yet, create a Control Plane cloud account for the AWS account holding the bucket. Set
backup.aws.cloudAccountNameto its name. -
Create an IAM policy scoped to exactly that bucket, replacing
YOUR_BUCKET_NAME:
- Set
backup.aws.policyNameto that policy’s name. The template attaches it to the workload identity and nothing else — the bucket in your policy is the only storage the backup job can reach.
GCS
-
Create a GCS bucket. Set
backup.gcp.bucketto its name. -
Create a Control Plane cloud account for the GCP project holding the bucket, and set
backup.gcp.cloudAccountNameto its name. -
Grant the cloud account’s service account the Storage Admin (
roles/storage.admin) role. The template additionally binds the identity toroles/storage.objectAdminon exactly the bucket inbackup.gcp.bucket.
MinIO
No cloud account is needed — the job authenticates with a second prerequisite secret.-
Create the bucket in MinIO. Set
backup.minio.bucketto its name. -
Set
backup.minio.endpointto the S3 API address including the port. For the MinIO template deployed in the same GVC that ishttp://WORKLOAD_NAME.GVC_NAME.cpln.local:9000. -
Create a dictionary secret holding exactly the keys
accessKeyandsecretKey, and setbackup.minio.credentialsSecretNameto its name. For the MinIO template these are its admin username and password:
reveal on this secret as well as the database credentials secret and the first-boot SQL secret, and on nothing else.
Backup retention
The backup job only uploads; it never deletes old backups. To keep a fixed window, add a lifecycle rule on the bucket that expires objects under the backup prefix. Each backup is a complete, standalone copy, so expiring old ones never affects restoring a newer one. Set the window to at least your retention plus one backup interval, and note that an age rule keeps no minimum: if backups stop running, the last ones expire too. The rules below use the default prefixpgvector/backups/; change it if you changed backup.<provider>.prefix.
AWS S3. put-bucket-lifecycle-configuration replaces every existing rule on the bucket, so check for existing rules first and add them to the file:
--lifecycle-file also replaces the bucket’s existing rules; check with gcloud storage buckets describe gs://BUCKET_NAME --format='json(lifecycle_config)' first:
s3:PutLifecycleConfiguration, which the built-in readwrite policy grants):
Noncurrent parts matter only on a versioned bucket, where expiry otherwise just adds a delete marker.
Restoring a Backup
Each backup is a gzip-compressedpg_dumpall script, so it is restored by connecting to the postgres maintenance database as the superuser from your credentials secret; the script recreates the roles and databases it contains. Because the dump includes CREATE EXTENSION IF NOT EXISTS vector, restore into a server whose image carries pgvector — a fresh install of this template, for example. Replaying it into a stock postgres image fails at that line and the tables are never created.
Run the commands from a client that can reach both the bucket and the server — a workload inside the GVC, or your own machine with cpln port-forward RELEASE_NAME-pgvector 5432:5432 --gvc GVC_NAME open and --host=127.0.0.1 in place of the internal hostname.
- AWS S3
- GCS
- MinIO
already exists errors for the role, the database and the vector extension that the server created at first boot are expected; the rest of the script loads normally. Restore into an empty database (a fresh install, or one whose tables you have dropped) to avoid duplicate-object errors on existing tables. Use a psql at least as new as the backup image (19 for the default) — an older client prints invalid command \unrestrict at the end of a newer dump.
A dump taken by the default postgres-backup:19.1.0 restores into PostgreSQL 19 or newer. Restoring it into a server pinned to PostgreSQL 18 can print unrecognized configuration parameter errors on SET lines, which psql skips; to keep backups that load cleanly into 18, set backup.image: ghcr.io/controlplane-com/backup-images/postgres-backup:18.1.0.
Rotating the Password
The server reads the secret only when the volume is first initialized, so change the password inside PostgreSQL first, then update the secret to match:Upgrading From 1.0.0
Version1.0.1 moves to pgvector 0.8.7, which fixes CVE-2026-103484: in 0.8.6 and earlier, a database user who can create an IVFFlat index can run arbitrary code on the server.
- If your values pin
image(an install through the Console wizard stores it), set it topgvector/pgvector:0.8.7-pg18(or-pg19on a new release). The chart refuses an official pgvector tag older than 0.8.7. - The fix is in the server library and is active after the upgrade’s restart; existing data and indexes need nothing.
\dxkeeps reportingvector0.8.6 until you runALTER EXTENSION vector UPDATE;in each database that has it, which only updates that record.
Upgrading From 1.x
New installs of 2.0.0 run PostgreSQL 19. A 1.x release’s data directory is PostgreSQL 18, and a PostgreSQL data directory only starts under the major version that created it. If a PostgreSQL 19 image meets an 18 data directory, the container does not start PostgreSQL and changes nothing on the volume: the replica stays not ready, and the logs repeat a[pg-guard] REFUSING TO START message with the exact fix.
Stay on PostgreSQL 18 with this chart. Pin the image, and keep the pin in your values file for every later upgrade — cpln helm upgrade does not reuse the release’s values:
--set image=pgvector/pgvector:0.8.7-pg18; the server comes back on its data. The Console wizard keeps the installed image on upgrade and blocks a change to another major.
A 1.0.0 release that pinned pgvector/pgvector:0.8.6-pg18 must move to 0.8.7-pg18: the chart refuses an official pgvector tag older than 0.8.7 (CVE-2026-103484). See Upgrading From 1.0.0.
Move to PostgreSQL 19 with a dump and restore into a new release.
Install 2.0.0 as a new release
config.extraExtensions. The dump carries each role’s password hash, so a different secret would no longer match.Stop writes to the old release
Stream the dump into the new server
pg_dumpall reads the 18 server and psql writes to the local server. already exists errors for the role, the database and the vector extension are expected. HNSW and IVFFlat indexes are rebuilt during the restore; for large ones raise resources.maxMemory first.Verify, switch clients and remove the old release
NEW_RELEASE-pgvector (or NEW_RELEASE-pgbouncer) and uninstall the old release.Scaling and Availability
- The server is pinned to one replica. Do not raise it — a second stateful replica gets its own volume, which is a second empty database rather than a replica.
- PgBouncer is stateless;
pgbouncer.replicasscales it horizontally for high connection counts. - Every
cpln helm upgraderestarts the server, including the first upgrade after an install even when nothing changed. Plan each one as a short write outage. Data on the volume survives, including built HNSW graphs, which are not rebuilt. - A node failure reschedules the server and reattaches the same volume. The exposure is minutes of downtime, not data loss.
- For automatic failover use PostgreSQL Highly Available, whose image also carries pgvector. Check its page for the PostgreSQL and pgvector versions it runs, which can differ from this template’s.
Troubleshooting
Workload never becomes ready and cpln logs returns nothing
Workload never becomes ready and cpln logs returns nothing
cpln logs '{gvc="GVC_NAME", workload="RELEASE_NAME-pgvector"}' --limit 50 --since 10m returns zero lines.Cause: config.credentialsSecretName names a secret that does not exist, so the container is never started. The message is only visible in status.versions[].message:cpln workload force-redeployment RELEASE_NAME-pgvector --gvc GVC_NAME.Install refused with 'Invalid config.extraExtensions entry'
Install refused with 'Invalid config.extraExtensions entry'
cpln helm install or upgrade stops before touching any resource:config.extraExtensions contains a hyphen, a capital letter or other punctuation. Entries are interpolated into SQL, so the chart only accepts bare lower-case identifiers.Fix: use the extension’s exact name as PostgreSQL knows it — pg_trgm, not pg-trgm.Server is healthy but an extension from config.extraExtensions is missing
Server is healthy but an extension from config.extraExtensions is missing
vector exists but CREATE EXTENSION for one of your extra extensions never ran, and the first-boot log shows ERROR: extension "NAME" is not available followed by a restart.Cause: the name is valid but the image does not ship that extension. The first-boot script stopped at that line; the restart found an initialized data directory and skipped initialization, so the remaining statements never ran.Fix: create the extensions the image does carry by hand with CREATE EXTENSION IF NOT EXISTS NAME;, and remove the unavailable one from config.extraExtensions. To start over with a corrected list, uninstall (which deletes the volume set) and reinstall.ERROR: unrecognized configuration parameter "hnsw.ef_search", or recall varies between identical queries through PgBouncer
ERROR: unrecognized configuration parameter "hnsw.ef_search", or recall varies between identical queries through PgBouncer
RELEASE_NAME-pgbouncer a plain SET hnsw.ef_search = ... sometimes errors with unrecognized configuration parameter, or SHOW hnsw.ef_search returns a value you did not set. Direct connections to RELEASE_NAME-pgvector behave normally.Cause: pgbouncer.poolMode: transaction hands the same server connection to different clients, so a session-level SET is not bound to the client that issued it.Fix: scope the setting with SET LOCAL inside a transaction (see Using pgvector), or set pgbouncer.poolMode: session.CREATE INDEX fails with 'column cannot have more than 2000 dimensions for hnsw index'
CREATE INDEX fails with 'column cannot have more than 2000 dimensions for hnsw index'
hnsw (or ivfflat) index on a vector(N) column with N above 2,000 fails with this error, although inserting the vectors worked.Cause: a vector column stores up to 16,000 dimensions but pgvector indexes it only up to 2,000.Fix: store the embeddings as halfvec(N), which indexes up to 4,000 dimensions, or reduce the embedding dimensionality.Client fails to connect to the public endpoint with sslmode=require
Client fails to connect to the public endpoint with sslmode=require
sslmode=require (or verify-ca / verify-full) cannot connect to the canonical endpoint, while the same credentials work without it.Cause: the image ships no TLS certificate, so the server does not offer SSL.Fix: use the libpq default sslmode=prefer, or sslmode=disable, and prefer the internal address RELEASE_NAME-pgvector.GVC_NAME.cpln.local over the public endpoint wherever possible.Apply rejected with 'The ratio between cpu and minCpu must be less than 4:1'
Apply rejected with 'The ratio between cpu and minCpu must be less than 4:1'
resources.maxCpu is more than four times resources.minCpu, which the platform rejects on a stateful workload.Fix: raise resources.minCpu or lower resources.maxCpu so the ratio is at most 4:1.Important Notes
- Create the credentials secret before installing. A reference to a secret that does not exist wedges the workload with no log output; see Prerequisites for the one command that shows the reason.
- The
vectorextension is created by this template, not by the image, in the database named in your credentials secret, on first boot only. - Credentials and
config.extraExtensionsare read only when the volume is first initialized. Add an extension later withCREATE EXTENSION IF NOT EXISTS ...; rotate a password withALTER ROLE, then update the secret — see Rotating the Password. - PgBouncer in
transactionmode leaks session settings between clients, includinghnsw.ef_search. UseSET LOCALinside a transaction, orpoolMode: session. publicAccessis unencrypted — the image ships no TLS certificate, sosslmode=requirefails. Prefer internal access.- Do not scale the server past one replica. It is a single instance on a single volume, not a replicated cluster.
- Every
cpln helm upgraderestarts the server. Treat each one as a short planned write outage. - Restore with a
psqlat least as new as the backup image (19 for the default), into a server that carries pgvector. An older client printsinvalid command \unrestrictagainst a newer dump, and a stockpostgresimage fails on the dump’sCREATE EXTENSIONline. - A 1.x release must pin
image: pgvector/pgvector:0.8.7-pg18on upgrade, or the start-up guard keeps the server not ready. Keep the pin in your values on every later upgrade; moving to 19 is a dump and restore. See Upgrading From 1.x. cpln helm uninstalldeletes the volume set and the database with it. Your credentials secret is yours and is left alone.