Skip to content

Commit

Permalink
scale up: tests for pods with volumes
Browse files Browse the repository at this point in the history
Whether a pod has unbound volumes influences scheduling decisions and
thus the scale up decisions in cluster autoscaler.

These three new test cases cover:
- a pod with an unbound pvc using late binding -> can scale up
- the same with storage capacity feature enabled -> cannot scale up
  without CSIStorageCapacity
- the same with manually configured CSIStorageCapacity -> can scale up
  • Loading branch information
pohly committed Feb 15, 2021
1 parent 962bbd0 commit 7c2b8c0
Show file tree
Hide file tree
Showing 8 changed files with 377 additions and 61 deletions.
30 changes: 29 additions & 1 deletion cluster-autoscaler/core/scale_test_common.go
Expand Up @@ -68,6 +68,30 @@ type podConfig struct {
gpu int64
node string
toleratesGpu bool
pvcs []string
}

type pvcConfig struct {
name string
size string // must parse as a resource.Quantity
storageclass string
}

type scConfig struct {
name string
provisioner string
}

type csiDriverConfig struct {
name string
storageCapacity bool
}

type csiStorageCapacityConfig struct {
name string
storageClass string
nodeLabels map[string]string
capacity string
}

type groupSizeChange struct {
Expand All @@ -79,6 +103,10 @@ type scaleTestConfig struct {
nodes []nodeConfig
pods []podConfig
extraPods []podConfig
pvcs []pvcConfig
scs []scConfig
csi []csiDriverConfig
cap []csiStorageCapacityConfig
options config.AutoscalingOptions
nodeDeletionTracker *NodeDeletionTracker
expansionOptionToChoose groupSizeChange // this will be selected by assertingStrategy.BestOption
Expand Down Expand Up @@ -160,7 +188,7 @@ func NewScaleTestAutoscalingContext(
// Ignoring error here is safe - if a test doesn't specify valid estimatorName,
// it either doesn't need one, or should fail when it turns out to be nil.
estimatorBuilder, _ := estimator.NewEstimatorBuilder(options.EstimatorName)
predicateChecker, err := simulator.NewTestPredicateChecker()
predicateChecker, err := simulator.NewSchedulerBasedPredicateChecker(fakeClient, make(chan struct{}))
if err != nil {
return context.AutoscalingContext{}, err
}
Expand Down

0 comments on commit 7c2b8c0

Please sign in to comment.