I'm using postgres operator but got confusing of those two configs in the docs:

PGO provides several ways to add replicas to make a HA cluster:

  • Increase the spec.instances.replicas value
  • Add an additional entry in spec.instances

https://access.crunchydata.com/documentation/postgres-operator/5.0.1/tutorial/high-availability/

So what is the difference (in term of HA benefit) between:

spec:
  instances:
    - name: i1
      replicas: 2

vs

spec:
  instances:
    - name: i1
      replicas: 1
    - name: i2
      replicas: 1

Why should I use first config over second config?

1

There are 1 best solutions below

0
On

No accepted answer, so I asked on Github, here is the issue link and the answer:

The advantage of the former (increasing the replicas count) is really just having a tidier spec and the convenience of simply increasing/decreasing one value to adjust your replicas. The advantage of the latter (adding separate instance specs) is that you can have different configurations for each instance. The possible configurations are documented here: