Skip to content

Commit 8f408e1

Browse files
jkatzJonathan S. Katz
authored andcommitted
Clarify different Pod anti-affinity options in docs
It is possible to fine tune the Pod anti-affinity settings for the managed Deployments in a PostgreSQL cluster, though this was not particularly clear in that section of the docs. Issue: #2342
1 parent d8c0705 commit 8f408e1

File tree

1 file changed

+24
-0
lines changed
  • docs/content/architecture/high-availability

1 file changed

+24
-0
lines changed

docs/content/architecture/high-availability/_index.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,30 @@ number of nodes are available to support this configuration, certain deployments
219219
will fail, since it will not be possible for Kubernetes to successfully schedule
220220
the pods for each deployment.
221221

222+
It is possible to fine tune the pod anti-affinity rules further, specifically,
223+
set different affinity rules for the PostgreSQL, pgBackRest, and pgBouncer
224+
Deployments. These can be handled by the following flags on [`pgo create cluster`]({{< relref "pgo-client/reference/pgo_create_cluster.md">}}):
225+
226+
- `--pod-anti-affinity`: Sets the pod anti-affinity rules for all the managed
227+
Deployments in the cluster (PostgreSQL, pgBackRest, pgBouncer)
228+
- `--pod-anti-affinity-pgbackrest`: Sets the pod anti-affinity rules for _only_
229+
the pgBackRest Deployment. This takes precedence over the value of
230+
`--pod-anti-affinity`.
231+
- `--pod-anti-affinity-pgbouncer`: Sets the pod anti-affinity rules for _only_
232+
the pgBouncer Deployment. This takes precedence over the value of
233+
`--pod-anti-affinity`.
234+
235+
For example, to use `required` pod anti-affinity between PostgreSQL instances
236+
but use only `preferred` anti-affinity for pgBackRest and pgBouncer, you could
237+
use the following command:
238+
239+
```
240+
pgo create cluster hippo --replicas=2 --pgbouncer \
241+
--pod-anti-affinity=required \
242+
--pod-anti-affinity=preferred \
243+
--pod-anti-afinity=preferred
244+
```
245+
222246
## Synchronous Replication: Guarding Against Transactions Loss
223247

224248
Clusters managed by the Crunchy PostgreSQL Operator can be deployed with

0 commit comments

Comments
 (0)