diff --git a/sources/eai-infra/airm-cnpg/0.1.0/templates/cnpg-cluster.yaml b/sources/eai-infra/airm-cnpg/0.1.0/templates/cnpg-cluster.yaml index 539a08d5..b049a061 100644 --- a/sources/eai-infra/airm-cnpg/0.1.0/templates/cnpg-cluster.yaml +++ b/sources/eai-infra/airm-cnpg/0.1.0/templates/cnpg-cluster.yaml @@ -11,7 +11,8 @@ metadata: spec: affinity: enablePodAntiAffinity: true - topologyKey: topology.kubernetes.io/zone + podAntiAffinityType: {{ .Values.podAntiAffinityType | quote }} + topologyKey: {{ .Values.topologyKey | quote }} bootstrap: initdb: database: {{ .Values.database }} diff --git a/sources/eai-infra/airm-cnpg/0.1.0/values.yaml b/sources/eai-infra/airm-cnpg/0.1.0/values.yaml index 2e452863..f236fecc 100644 --- a/sources/eai-infra/airm-cnpg/0.1.0/values.yaml +++ b/sources/eai-infra/airm-cnpg/0.1.0/values.yaml @@ -7,6 +7,12 @@ database: "airm" username: "airm_user" image: "ghcr.io/cloudnative-pg/postgresql:17.2" instances: 1 +# Spread instances across distinct nodes. "preferred" schedules them apart when +# nodes allow it and falls back to co-scheduling otherwise, so a cluster with +# fewer nodes than instances still comes up. Set "required" to make the spread +# binding, which leaves surplus instances Pending until nodes are added. +podAntiAffinityType: "preferred" +topologyKey: "kubernetes.io/hostname" userSecretName: "airm-cnpg-user" superuserSecretName: "airm-cnpg-superuser" sharedBuffers: "256MB" diff --git a/sources/eai-infra/aiwb-cnpg/0.1.0/templates/cnpg-cluster.yaml b/sources/eai-infra/aiwb-cnpg/0.1.0/templates/cnpg-cluster.yaml index 539a08d5..b049a061 100644 --- a/sources/eai-infra/aiwb-cnpg/0.1.0/templates/cnpg-cluster.yaml +++ b/sources/eai-infra/aiwb-cnpg/0.1.0/templates/cnpg-cluster.yaml @@ -11,7 +11,8 @@ metadata: spec: affinity: enablePodAntiAffinity: true - topologyKey: topology.kubernetes.io/zone + podAntiAffinityType: {{ .Values.podAntiAffinityType | quote }} + topologyKey: {{ .Values.topologyKey | quote }} bootstrap: initdb: database: {{ .Values.database }} diff --git a/sources/eai-infra/aiwb-cnpg/0.1.0/values.yaml b/sources/eai-infra/aiwb-cnpg/0.1.0/values.yaml index a6e4fccf..119bac20 100644 --- a/sources/eai-infra/aiwb-cnpg/0.1.0/values.yaml +++ b/sources/eai-infra/aiwb-cnpg/0.1.0/values.yaml @@ -7,6 +7,12 @@ database: "aiwb" username: "aiwb_user" image: "ghcr.io/cloudnative-pg/postgresql:17.2" instances: 3 +# Spread instances across distinct nodes. "preferred" schedules them apart when +# nodes allow it and falls back to co-scheduling otherwise, so a cluster with +# fewer nodes than instances still comes up. Set "required" to make the spread +# binding, which leaves surplus instances Pending until nodes are added. +podAntiAffinityType: "preferred" +topologyKey: "kubernetes.io/hostname" userSecretName: "aiwb-cnpg-user" superuserSecretName: "aiwb-cnpg-superuser" sharedBuffers: "256MB" diff --git a/sources/keycloak-config/templates/keycloak-cluster.yaml b/sources/keycloak-config/templates/keycloak-cluster.yaml index 128e766d..a794a406 100644 --- a/sources/keycloak-config/templates/keycloak-cluster.yaml +++ b/sources/keycloak-config/templates/keycloak-cluster.yaml @@ -66,7 +66,8 @@ metadata: spec: affinity: enablePodAntiAffinity: true - topologyKey: topology.kubernetes.io/zone + podAntiAffinityType: {{ .Values.cnpg.podAntiAffinityType | quote }} + topologyKey: {{ .Values.cnpg.topologyKey | quote }} bootstrap: initdb: database: keycloak diff --git a/sources/keycloak-config/values.yaml b/sources/keycloak-config/values.yaml index 8f577f31..ca2df535 100644 --- a/sources/keycloak-config/values.yaml +++ b/sources/keycloak-config/values.yaml @@ -9,3 +9,9 @@ cnpg: # so node maintenance stalls until someone disables it by hand. # Set true or false to override. enablePDB: null + # Spread instances across distinct nodes. "preferred" schedules them apart + # when nodes allow it and falls back to co-scheduling otherwise, so a cluster + # with fewer nodes than instances still comes up. Set "required" to make the + # spread binding, which leaves surplus instances Pending until nodes exist. + podAntiAffinityType: "preferred" + topologyKey: "kubernetes.io/hostname"