mirror of https://github.com/k3s-io/k3s
Autoscaler e2e tests use allocatable to calculate resources
parent
36877dafe4
commit
31fb5b236f
|
@ -115,8 +115,8 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||
nodeCount = len(nodes.Items)
|
||||
coreCount = 0
|
||||
for _, node := range nodes.Items {
|
||||
quentity := node.Status.Capacity[v1.ResourceCPU]
|
||||
coreCount += quentity.Value()
|
||||
quantity := node.Status.Allocatable[v1.ResourceCPU]
|
||||
coreCount += quantity.Value()
|
||||
}
|
||||
By(fmt.Sprintf("Initial number of schedulable nodes: %v", nodeCount))
|
||||
Expect(nodeCount).NotTo(BeZero())
|
||||
|
@ -369,6 +369,9 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||
defer deleteNodePool(extraPoolName)
|
||||
extraNodes := getPoolInitialSize(extraPoolName)
|
||||
framework.ExpectNoError(framework.WaitForReadyNodes(c, nodeCount+extraNodes, resizeTimeout))
|
||||
// We wait for nodes to become schedulable to make sure the new nodes
|
||||
// will be returned by getPoolNodes below.
|
||||
framework.ExpectNoError(framework.WaitForAllNodesSchedulable(c, resizeTimeout))
|
||||
glog.Infof("Not enabling cluster autoscaler for the node pool (on purpose).")
|
||||
|
||||
By("Getting memory available on new nodes, so we can account for it when creating RC")
|
||||
|
@ -376,7 +379,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
|
|||
Expect(len(nodes)).Should(Equal(extraNodes))
|
||||
extraMemMb := 0
|
||||
for _, node := range nodes {
|
||||
mem := node.Status.Capacity[v1.ResourceMemory]
|
||||
mem := node.Status.Allocatable[v1.ResourceMemory]
|
||||
extraMemMb += int((&mem).Value() / 1024 / 1024)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue