Skip to content

Commit

Permalink
Add a PoolLabel selector to PodAntiAffinity (#1925)
Browse files Browse the repository at this point in the history
Add a PoolLabel selector to PodAntiAffinity to ensure that the kubectl-minio plugin expand command allows pod in one pool to be scheduled on available nodes when pods from another pool have already been scheduled on those same nodes
  • Loading branch information
allanrogerr authored Jan 2, 2024
1 parent a82bc93 commit 64cb15e
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions kubectl-minio/cmd/resources/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,18 @@ func Pool(opts *TenantOptions, volumes int32, q resource.Quantity) miniov2.Pool
RequiredDuringSchedulingIgnoredDuringExecution: []corev1.PodAffinityTerm{
{
LabelSelector: &metav1.LabelSelector{
MatchExpressions: []metav1.LabelSelectorRequirement{{
Key: miniov2.TenantLabel,
Operator: "In",
Values: []string{opts.Name},
}},
MatchExpressions: []metav1.LabelSelectorRequirement{
{
Key: miniov2.TenantLabel,
Operator: "In",
Values: []string{opts.Name},
},
{
Key: miniov2.PoolLabel,
Operator: "In",
Values: []string{opts.Name},
},
},
},
TopologyKey: "kubernetes.io/hostname",
},
Expand Down

0 comments on commit 64cb15e

Please sign in to comment.