Recommended procedure for adding extensions
We occasionally get GH issues raised about (a) about providing instructions to add extensions themselves and (b) adding new extensions to our PG image.
Our current (Q4 2023) policy is that
(a) we do not have instructions for developers; we do have instructions for customers.
(b) we do not usually respond to requests by adding new extensions — but we might add new extensions in the future.
This ticket is meant to be a parent/clearinghouse for public requested extension. If/when there is an outpouring of interest in one of these extensions, we may want to scheduled the work.
I'm also interested in installing stuff, but in my case I'd add FDWs.
Another way to go about this would to provide the pgsql-13 folder as yet another PVC that is copied the first time from the image to the destination (as in the PVC being empty triggers the copy).
Not sure what the consequences would be besides having to add fsGroup to the SecurityContext of the Kubernetes' pod in case Pod Security Policy is enabled.
Another wilder idea would add a CLI command to install extensions. That one would be amazing, if at all possible.
I'm not sure about the current situation, So is there a way to add extensions to the cluster?
If you have still problem, just create another Dockerfile which extends default crunchy-postgres-gis container. In my case I downloaded oracle_fdw extension locally and it looks like this:
FROM registry.developers.crunchydata.com/crunchydata/crunchy-postgres-gis:ubi8-14.4-3.2-0
COPY oracle_fdw-ORACLE_FDW_2_4_0 /usr/pgsql-14/share/extension/
Then build image and use it in your kustomize / helm chart.
It's not necessarily as simple as that - the crunchy image doesn't ship any development headers so you can't build extensions.
just do it yourself :) pull crunchy-containers suite via github and extend the dockerfiles.
Best regards