Recommended way to configure max_prepared_transactions in Postgres on Kubernetes

8/21/2017

What is the simplest way to configure parameter max_prepared_transactions=100 in docker kubernetes?

I am using image:

https://hub.docker.com/_/postgres/

Which has postgresql.conf file at /var/lib/postgresql/data

In my kubernetes deployment, that directory is externally mounted so I can't copy postgresql.conf using Dockerfile so I need to specify that parameter as a ENV parameter in Kubernetes .yml file, or changing the location of postgresql.conf file to, for example, /etc/postgresql.conf (how can I do this as a ENV parameter too?)

Thanks

-- icordoba
kubernetes
postgresql

1 Answer

4/1/2019

You can set this config as runtime flag when you start your docker container. Something like this:

$ docker run -d postgres --max_prepared_transactions=100
-- Milan
Source: StackOverflow