mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-17 20:08:17 +02:00
add preferred during scheduling pod anti affinity (#2048)
* add preferred during scheduling pod anti affinity Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
This commit is contained in:
co-authored by
Felix Kunde
parent
93a253bde1
commit
be7b52db92
@@ -354,7 +354,12 @@ func (c *Cluster) generateConnectionPoolerPodTemplate(role PostgresRole) (
|
||||
nodeAffinity := c.nodeAffinity(c.OpConfig.NodeReadinessLabel, spec.NodeAffinity)
|
||||
if c.OpConfig.EnablePodAntiAffinity {
|
||||
labelsSet := labels.Set(c.connectionPoolerLabels(role, false).MatchLabels)
|
||||
podTemplate.Spec.Affinity = generatePodAffinity(labelsSet, c.OpConfig.PodAntiAffinityTopologyKey, nodeAffinity)
|
||||
podTemplate.Spec.Affinity = generatePodAffinity(
|
||||
labelsSet,
|
||||
c.OpConfig.PodAntiAffinityTopologyKey,
|
||||
nodeAffinity,
|
||||
c.OpConfig.PodAntiAffinityPreferredDuringScheduling,
|
||||
)
|
||||
} else if nodeAffinity != nil {
|
||||
podTemplate.Spec.Affinity = nodeAffinity
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user