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:
parent
ee66560661
commit
65551e4602
1 changed files with 8 additions and 9 deletions
|
|
@ -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"
|
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue