Skip to content

Feat/extensions - #86

Open
spron-in wants to merge 6 commits into
mainfrom
feat/extensions
Open

spron-in wants to merge 6 commits into
mainfrom
feat/extensions

Conversation

@spron-in

Copy link
Copy Markdown
Collaborator

Adding more extensions that CNPG supports + tests

Data-driven extension toggles under spec.components.engine.parameters.extensions:
pgvector and pgaudit (bundled in the standard images, PG 14-18) and the
CloudNativePG extension images (PG 18 + ImageVolume) timescaledb, postgis,
pgrouting, pg_ivm and wal2json.

CREATE EXTENSION runs through a single Database resource <instance>-extensions,
since CloudNativePG allows one Database object per database. This also fixes
TimescaleDB instances never becoming Ready: its Database resource was never
synced on main.

Signed-off-by: Sergey Pronin <sp@solanica.io>
Signed-off-by: Sergey Pronin <sp@solanica.io>
extensions/bundled (pgvector, pgaudit on PG 17) runs with make test-integration.
extensions/imagevolume (timescaledb, postgis, pgrouting, pg_ivm, wal2json on
PG 18) needs Kubernetes ImageVolume, so it is labelled requires=imagevolume,
skipped by default and run with make test-integration-imagevolume.

Signed-off-by: Sergey Pronin <sp@solanica.io>
Comment thread internal/cnpg/extensions.go Outdated
Comment thread definition/topologies/replicaSet/topology.yaml
Comment thread Makefile Outdated
Signed-off-by: Sergey Pronin <sp@solanica.io>

# Conflicts:
#	definition/topologies/replicaSet/topology.yaml
#	internal/provider/provider.go
…talog

Image-volume extension images are no longer hardcoded in the provider. The
chart renders a CloudNativePG ClusterImageCatalog from values.extensionCatalog
(SQL versions as sql-version.extensions.openeverest.io/<major>.<name>
annotations); the provider copies the entry of each enabled extension into the
Cluster, so admins can bump or mirror images without a provider upgrade.

Adds Apache AGE (ghcr.io/solanicaio/age, PostgreSQL 18): preloaded, created in
the application database, and the owner gets USAGE on ag_catalog through
bootstrap default privileges, so it can only be enabled at creation.

Also makes the replicaset suite's delete step tolerate the Cluster already
being garbage-collected.

Signed-off-by: Sergey Pronin <sp@solanica.io>
…e tests in CI

PostGIS, pgRouting and wal2json can now be enabled on a running instance from
the UI (a rolling restart; PostGIS/pgRouting still cannot be disabled).
TimescaleDB and pg_ivm stay create-only because they add an image and a preload
library in one rollout, and AGE needs its bootstrap grant. The README documents
which extensions can be enabled later or disabled.

The dev/CI k3d cluster moves to k3s 1.36 (ImageVolume on by default), so
`make test-integration` runs the image-volume suite instead of skipping it.

Signed-off-by: Sergey Pronin <sp@solanica.io>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants