Skip to content

Commit ca8be9c

Browse files
committed
postgres: specify antiaffinity rules
With current setup we are running into situations where postgres instances are not spread evenly across the nodes: ``` ❯ kubectl cnpg status nautobot-cluster -n nautobot ... Instances status Name Current LSN Replication role Status QoS Manager Version Node ---- ----------- ---------------- ------ --- --------------- ---- nautobot-cluster-4 16C/C4001338 Primary OK BestEffort 1.26.0 1327175-hp3 nautobot-cluster-5 16C/C4001338 Standby (async) OK BestEffort 1.26.0 1327174-hp2 nautobot-cluster-6 16C/C4001338 Standby (async) OK BestEffort 1.26.0 1327174-hp2 ``` Adding the rules here will ensure that they are distributed across multiple servers.
1 parent e2ab955 commit ca8be9c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/nautobot/cloudnative-postgres-nautobot.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ spec:
1111
instances: 3
1212
storage:
1313
size: 20Gi
14+
affinity:
15+
podAntiAffinityType: required
16+
topologyKey: kubernetes.io/hostname
1417
monitoring:
1518
enablePodMonitor: true
1619
---

0 commit comments

Comments
 (0)