From bde160fbcc42cff53e217ce90da4e3244ff96ca2 Mon Sep 17 00:00:00 2001 From: JJGadgets Date: Sun, 10 Nov 2024 16:43:46 +0800 Subject: [PATCH] fix(pg/clusters): schedule on CPs only --- kube/deploy/core/db/pg/clusters/template/crunchy.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kube/deploy/core/db/pg/clusters/template/crunchy.yaml b/kube/deploy/core/db/pg/clusters/template/crunchy.yaml index 885737df..9f85e12f 100644 --- a/kube/deploy/core/db/pg/clusters/template/crunchy.yaml +++ b/kube/deploy/core/db/pg/clusters/template/crunchy.yaml @@ -1,4 +1,5 @@ --- +# yaml-language-server: $schema=https://crds.jank.ing/postgres-operator.crunchydata.com/postgrescluster_v1beta1.json apiVersion: postgres-operator.crunchydata.com/v1beta1 kind: PostgresCluster metadata: @@ -39,6 +40,13 @@ spec: limits: cpu: "${PG_CPU_LIMIT:=2000m}" memory: "${PG_MEM_LIMIT:=2Gi}" + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-role.kubernetes.io/control-plane + operator: Exists topologySpreadConstraints: - maxSkew: 1 topologyKey: "kubernetes.io/hostname"