From 64cb15eb5d56d35a3d45027cb23caacdbdcc1e00 Mon Sep 17 00:00:00 2001 From: Allan Roger Reid Date: Tue, 2 Jan 2024 10:10:09 -0600 Subject: [PATCH] Add a PoolLabel selector to PodAntiAffinity (#1925) 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 --- kubectl-minio/cmd/resources/common.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/kubectl-minio/cmd/resources/common.go b/kubectl-minio/cmd/resources/common.go index 30b3a03979d..3e381dd96ac 100644 --- a/kubectl-minio/cmd/resources/common.go +++ b/kubectl-minio/cmd/resources/common.go @@ -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", },