mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-01 17:29:00 +00:00
Merge pull request #36780 from yujuhong/use_labels
Automatic merge from submit-queue e2e pod cleanup test: restrict pods to be assigned to nodes observed … The test checks the individual kubelet /runningPods endpoint based on the initial list of nodes it observes. It is important that all pods are scheduled only onto those nodes. Apply node labels to ensure no stray pods on other nodes. This fixes #35197
This commit is contained in:
@@ -137,19 +137,20 @@ var _ = framework.KubeDescribe("kubelet", func() {
|
||||
|
||||
BeforeEach(func() {
|
||||
c = f.ClientSet
|
||||
// Use node labels to restrict the pods to be assigned only to the
|
||||
// nodes we observe initially.
|
||||
nodeLabels = make(map[string]string)
|
||||
nodeLabels["kubelet_cleanup"] = "true"
|
||||
|
||||
nodes := framework.GetReadySchedulableNodesOrDie(c)
|
||||
numNodes = len(nodes.Items)
|
||||
nodeNames = sets.NewString()
|
||||
// If there are a lot of nodes, we don't want to use all of them
|
||||
// (if there are 1000 nodes in the cluster, starting 10 pods/node
|
||||
// will take ~10 minutes today). And there is also deletion phase.
|
||||
//
|
||||
// Instead, we choose at most 10 nodes and will constraint pods
|
||||
// that we are creating to be scheduled only on that nodes.
|
||||
// Instead, we choose at most 10 nodes.
|
||||
if numNodes > maxNodesToCheck {
|
||||
numNodes = maxNodesToCheck
|
||||
nodeLabels = make(map[string]string)
|
||||
nodeLabels["kubelet_cleanup"] = "true"
|
||||
}
|
||||
for i := 0; i < numNodes; i++ {
|
||||
nodeNames.Insert(nodes.Items[i].Name)
|
||||
|
Reference in New Issue
Block a user