autoscaler icon indicating copy to clipboard operation
autoscaler copied to clipboard

Add podScaleUpDelay annotation support

Open damirda opened this issue 2 years ago • 3 comments

Which component this PR applies to?

cluster-autoscaler

What type of PR is this?

/kind feature

What this PR does / why we need it:

Extends existing option/feature new-pod-scale-up-delay that is global for all the pods and adds ability to specify custom delay per pod through annotation cluster-autoscaler.kubernetes.io/pod-scale-up-delay. This allows better control over scale up process in the situations when we are running a lot of batch jobs at the regular intervals, like run this job every hour, but it is ok to wait 5 minutes to start.

Which issue(s) this PR fixes:

There was a discussion on this issue and someone suggested this solution. I liked it, implemented it, and it worked well for what I needed. https://github.com/kubernetes/autoscaler/issues/3916

Special notes for your reviewer:

Does this PR introduce a user-facing change?

A new annotation `cluster-autoscaler.kubernetes.io/pod-scale-up-delay` has been added, which allows user to set `new-pod-scale-up-delay` per pod, instead of autoscaler wide configuration. Annotation value will be used only if it is larger then global `new-pod-scale-up-delay`.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


damirda avatar Jun 09 '22 15:06 damirda

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: damirda / name: Damir Marković (647547946fb49343d258bfdb96390eb66b067c94)

Welcome @damirda!

It looks like this is your first PR to kubernetes/autoscaler 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/autoscaler has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Jun 09 '22 15:06 k8s-ci-robot

@x13n Thank you for your help with this PR so far! I added FAQ entry that basically covers my use case. I also added unit test for the existing function that I extended. Let me know if I should add more tests or if you think FAQ update should be more generalized.

damirda avatar Aug 21 '22 00:08 damirda

This failing test seem to be flaky. Works fine locally and also master is not broken. Plus completely unrelated to my changes. What is the best way to handle that?

damirda avatar Aug 29 '22 19:08 damirda

Never mind, restarting the build helped...

damirda avatar Aug 29 '22 22:08 damirda

/lgtm

x13n avatar Sep 02 '22 18:09 x13n

/assign @aleksandra-malinowska

damirda avatar Sep 02 '22 18:09 damirda

@x13n Thank you for all your help on this PR. I will squash all the commits in the end and prepare this for a merge.

damirda avatar Sep 02 '22 18:09 damirda

/cc @aleksandra-malinowska @feiskyer

damirda avatar Sep 04 '22 16:09 damirda

Merge will happen automatically once this has both lgtm and approved labels, so I'd suggest doing it first (it will also reset the lgtm tag, so I'll need to reapply it).

x13n avatar Sep 05 '22 09:09 x13n

/lgtm

x13n avatar Sep 06 '22 06:09 x13n

/assign @towca

x13n avatar Sep 22 '22 19:09 x13n

@towca Could we get a review here?

damirda avatar Oct 12 '22 11:10 damirda

Looks good to me, thanks for the contribution!

/approve

towca avatar Oct 13 '22 16:10 towca

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damirda, towca

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Oct 13 '22 16:10 k8s-ci-robot