We wanted to transition to using the CloudNativePG for our in-clusted database management. Problem was that we were using Citus's columar for data storage. This extension is not available in the default Docker image.
One cannot simply use Citus Docker image as CNPG has some requirements for the image itself.
Prepare the image we want to use
docker build . -t registry.gitlab.com/ampiato/ampiato/postgresql-cnpg:16.6-11-bullseye
docker push registry.gitlab.com/ampiato/ampiato/postgresql-cnpg:16.6-11-bullseye
Setup CNPG to use the image.
kubectl create namespace postgres
kubectl apply -f cluster_image_catalog.yml
Then restart the cnpg manager such that it reloads the ConfigMap
kubectl delete pod -n cnpg-system cnpg-cloudnative-pg-77f488cf89-flbds
And finally create the cluster itself.
kubectl apply -f cluster.yml
Load the extension
❯ kubectl cnpg psql postgres-cluster ─╯
psql (16.6 (Debian 16.6-1.pgdg110+1))
Type "help" for help.
postgres=# create extension citus;
CREATE EXTENSION
postgres=#
❯ kubectl cnpg psql postgres-cluster ─╯
psql (16.6 (Debian 16.6-1.pgdg110+1))
Type "help" for help.
postgres=# SELECT * FROM pg_extension;
oid | extname | extowner | extnamespace | extrelocatable | extversion | extconfig | extcondition
-------+----------------+----------+--------------+----------------+------------+-----------+--------------
13541 | plpgsql | 10 | 11 | f | 1.0 | |
16401 | citus_columnar | 10 | 11 | f | 11.3-1 | |
16457 | citus | 10 | 11 | f | 12.1-1 | |
(3 rows)```
## Secrets
You need to provide the pull-secret that can access the docker image you just built. CNPG will copy its content to `postgres-cluster-pull`.
I guess you can delete the original secret after that.