PostgreSQL docker image and deployment strategy

8/1/2017

Is there any reason why is default strategy for PostgreSQL set on Recrate? Could I set it on Rolling, or that could create some inconsistency in the database?

-- dplesa
docker
kubernetes
openshift
postgresql

1 Answer

8/31/2017

The default PostgreSQL template is not scalable. When you only have a single instance/pod, rolling and recreate are functionally equivalent. In the case that you were using PostgreSQL replication with the provided image, the template provides for a single master and multiple slaves. The single master will have the same issue described above (one instance), but the slaves scale separately. In some cases, like security updates to the operating system or very minor updates to PostgreSQL, you could probably get away with using a rolling deployment on the slaves. However, with rolling deployment enabled, you could get into a situation where you have a running master running PostgreSQL 9.6 and some running slaves on 9.5 (or 9.5.8 master and mix of 9.5.8 and 9.5.2 slaves) temporarily during the rolling deployment of the slaves, which may or may not end up causing issues. Re-create feels like the safe bet even in the replication scenario.

-- luciddreamz
Source: StackOverflow