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 Sep 21, 2021
1 parent 9d51239 commit 9b533c3
Show file tree
Hide file tree
Showing 3 changed files with 293 additions and 55 deletions.
30 changes: 29 additions & 1 deletion cluster-autoscaler/core/scale_test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,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 @@ -81,6 +105,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 @@ -164,7 +192,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
Loading

0 comments on commit 9b533c3

Please sign in to comment.