Merge pull request #52991 from aleksandra-malinowska/gke-scale-to-0-test

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

Enable autoscaling test of scale down to 0 in GKE

This change will cause "Should be able to scale a node group down to 0[Feature:ClusterSizeAutoscalingScaleDown]" test scenario to run in GKE jobs. It affects only cluster size autoscaling test suite.
This commit is contained in:
Kubernetes Submit Queue 2017-09-25 08:27:35 -07:00 committed by GitHub
commit 086bda60e5

View File

@ -619,8 +619,20 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
framework.ExpectNoError(waitForAllCaPodsReadyInNamespace(f, c))
})
It("Should be able to scale a node group down to 0[Feature:ClusterSizeAutoscalingScaleDown]", func() {
framework.SkipUnlessAtLeast(len(originalSizes), 2, "At least 2 node groups are needed for scale-to-0 tests")
It("Should be able to scale a node group down to 0[Feature:ClusterSizeAutoscalingXScaleDown]", func() {
// Determine whether we want to run & adjust the setup if necessary
if len(originalSizes) < 2 {
if framework.ProviderIs("gke") {
const extraPoolName = "extra-pool"
addNodePool(extraPoolName, "n1-standard-4", 1)
defer deleteNodePool(extraPoolName)
err := enableAutoscaler(extraPoolName, 0, 1)
framework.ExpectNoError(err)
} else {
framework.Skipf("At least 2 node groups are needed for scale-to-0 tests")
}
}
By("Find smallest node group and manually scale it to a single node")
minMig := ""
minSize := nodeCount