Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scaleDownDelayAfterAdd to clusterAutoscaler spec #11140

Merged
merged 1 commit into from
Mar 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ Cluster autoscaler can be enabled to automatically adjust the size of the kubern
spec:
clusterAutoscaler:
enabled: true
expander: least-waste
balanceSimilarNodeGroups: false
scaleDownUtilizationThreshold: 0.5
skipNodesWithLocalStorage: true
skipNodesWithSystemPods: true
newPodScaleUpDelay: 0s
scaleDownDelayAfterAdd: 10m0s
image: <the latest supported image for the specified kubernetes version>
cpuRequest: "100m"
memoryRequest: "300Mi"
```
Expand Down
4 changes: 4 additions & 0 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,10 @@ spec:
ignore unschedulable pods until they are a certain "age", regardless
of the scan-interval Default: 0s'
type: string
scaleDownDelayAfterAdd:
description: 'ScaleDownDelayAfterAdd determines the time after
scale up that scale down evaluation resumes Default: 10m0s'
type: string
scaleDownUtilizationThreshold:
description: 'ScaleDownUtilizationThreshold determines the utilization
threshold for node scale-down. Default: 0.5'
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/kops/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,9 @@ type ClusterAutoscalerConfig struct {
// NewPodScaleUpDelay causes cluster autoscaler to ignore unschedulable pods until they are a certain "age", regardless of the scan-interval
// Default: 0s
NewPodScaleUpDelay *string `json:"newPodScaleUpDelay,omitempty"`
// ScaleDownDelayAfterAdd determines the time after scale up that scale down evaluation resumes
// Default: 10m0s
ScaleDownDelayAfterAdd *string `json:"scaleDownDelayAfterAdd,omitempty"`
// Image is the docker container used.
// Default: the latest supported image for the specified kubernetes version.
Image *string `json:"image,omitempty"`
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/kops/v1alpha2/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,9 @@ type ClusterAutoscalerConfig struct {
// NewPodScaleUpDelay causes cluster autoscaler to ignore unschedulable pods until they are a certain "age", regardless of the scan-interval
// Default: 0s
NewPodScaleUpDelay *string `json:"newPodScaleUpDelay,omitempty"`
// ScaleDownDelayAfterAdd determines the time after scale up that scale down evaluation resumes
// Default: 10m0s
ScaleDownDelayAfterAdd *string `json:"scaleDownDelayAfterAdd,omitempty"`
// Image is the docker container used.
// Default: the latest supported image for the specified kubernetes version.
Image *string `json:"image,omitempty"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/model/components/clusterautoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ func (b *ClusterAutoscalerOptionsBuilder) BuildOptions(o interface{}) error {
if cas.NewPodScaleUpDelay == nil {
cas.NewPodScaleUpDelay = fi.String("0s")
}
if cas.ScaleDownDelayAfterAdd == nil {
cas.ScaleDownDelayAfterAdd = fi.String("10m0s")
}

return nil
}
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ spec:
- --scale-down-utilization-threshold={{ .ScaleDownUtilizationThreshold }}
- --skip-nodes-with-local-storage={{ .SkipNodesWithLocalStorage }}
- --skip-nodes-with-system-pods={{ .SkipNodesWithSystemPods }}
- --scale-down-delay-after-add={{ .ScaleDownDelayAfterAdd }}
- --new-pod-scale-up-delay={{ .NewPodScaleUpDelay }}
- --stderrthreshold=info
- --v=2
Expand Down