fix(dbaas): relax MySQL anti-affinity from required to preferred

Avoids pods getting stuck Pending during node outages while still
preferring to spread across nodes.
This commit is contained in:
Viktor Barzin 2026-04-11 16:26:24 +01:00
parent ee66560661
commit 65551e4602

View file

@ -265,17 +265,16 @@ resource "helm_release" "mysql_cluster" {
} }
} }
podAntiAffinity = { podAntiAffinity = {
# Required anti-affinity: MySQL pods MUST be on different nodes. preferredDuringSchedulingIgnoredDuringExecution = [{
# During node loss, one pod will be Pending this is acceptable because weight = 100
# InnoDB Cluster operates with 2/3 members (OK_NO_TOLERANCE). podAffinityTerm = {
# The descheduler (every 5 min) handles violations if any occur. labelSelector = {
requiredDuringSchedulingIgnoredDuringExecution = [{ matchLabels = {
labelSelector = { "component" = "mysqld"
matchLabels = { }
"component" = "mysqld"
} }
topologyKey = "kubernetes.io/hostname"
} }
topologyKey = "kubernetes.io/hostname"
}] }]
} }
} }