Skip to content

Commit

Permalink
changed pod anti affinity scheduling rule
Browse files Browse the repository at this point in the history
  • Loading branch information
ksimon1 committed Apr 11, 2019
1 parent 5248a0e commit 0af5f33
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions pkg/virt-operator/creation/components/deployments.go
Expand Up @@ -246,18 +246,21 @@ func newBaseDeployment(name string, namespace string, repository string, version
func newPodAntiAffinity(key, topologyKey string, operator metav1.LabelSelectorOperator, values []string) *corev1.Affinity {
return &corev1.Affinity{
PodAntiAffinity: &corev1.PodAntiAffinity{
RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{
PreferredDuringSchedulingIgnoredDuringExecution: []corev1.WeightedPodAffinityTerm{
{
LabelSelector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
{
Key: key,
Operator: operator,
Values: values,
Weight: 1,
PodAffinityTerm: corev1.PodAffinityTerm{
LabelSelector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{
{
Key: key,
Operator: operator,
Values: values,
},
},
},
TopologyKey: topologyKey,
},
TopologyKey: topologyKey,
},
},
},
Expand Down

0 comments on commit 0af5f33

Please sign in to comment.