I need to install custom dictionaries on a Percona Postgres cluster on Kubernetes that was created using Operator 2.2.
I have found the folder for dictionaries. It is: /usr/pgsql-15/share/tsearch_data
but only root can write to this folder.
Does anyone here know how to install custom dictionaries on Postgres instances?
I have also found a configuration setting in the Patroni docs that allows one to create ‘additionalVolumes’.
The docs say:
additionalVolumes List of additional volumes to mount in each container of the statefulset pod. Each item must contain a name, mountPath, and volumeSource which is a kubernetes volumeSource. It allows you to mount existing PersistentVolumeClaims, ConfigMaps and Secrets inside the StatefulSet. Also an emptyDir volume can be shared between initContainer and statefulSet. Additionaly, you can provide a SubPath for volume mount (a file in a configMap source volume, for example). You can also specify in which container the additional Volumes will be mounted with the targetContainers array option. If targetContainers is empty, additional volumes will be mounted only in the postgres container. If you set the all special item, it will be mounted in all containers (postgres + sidecars). Else you can set the list of target containers in which the additional volumes will be mounted (eg : postgres, telegraf)
See here for more info: Zalando Postgres Operator in Production: the way of Helm | by Zhangir Kapishov | Medium … Zalando SE are the patroni people, which is part of the Percona Operator and the CrunchyData Operator.
So, I am also going to try to create a storage volume for /usr/pgsql-15/share/tsearch_data in the instances. I’ll likely loose the existing contents so I’ll first copy those files over, change the config, add the new volume and then copy everything back on the host.
ok… this did not work:
- name: shared-data
It does not seem to be supported by the percona operator…
So… the options that I can see are:
- modify the operator so that it creats additional shares so I can share that folder. Ideal but seems like alot of work.
- create my own instance image based on the Percona image but with that folder writable… not sure if that is possible. I can not see where the instance image name is configured. Percona, Can you tell me?
- find the root password. Not ideal but I could manually copy over the files that I need to each instance. Can you guys provide the password or is there a way to set it when configuring the cluster?
- Create a sidecar that has it’s own shared volume and with root access copy the files over myself. I still need root access and this is not a great way to do this because these files are meant to be insallable without a database restart. Can you guys provide the password or is there a way to set it when configuring the cluster?
- Ask you guys to add this new feature to the Percona Operator so that people with text search databases can use the Percona Operator. Something like what the Zalando Postgres Operator has. Best long term solution but my guess is that this will take AGES.
- any other suggestions? Is there something in the PGO that I have not yet discovered? This lack of functionality seems like a HUGE oversite since the shared folder is supposed to be modifyable.