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

feat: Provide support for explicitly pausing autoscaling of ScaledJobs #4558

Merged
merged 2 commits into from Jun 22, 2023

Conversation

flux-benj
Copy link
Contributor

@flux-benj flux-benj commented May 21, 2023

--- Accreditation ---

Original PR: #3828

Borrows from the work originally implemented by: https://github.com/keegancwinchester

Note: I would have loved to have pulled the commit from the original branch, but I could not be able to.

Documentation MR by original implementor: kedacore/keda-docs#932

--- Fixes ---

Fixes #3303

--- PR Notes ---

Introduce annotation to pause ScaledJobs.

Checklist

@flux-benj flux-benj requested a review from a team as a code owner May 21, 2023 23:28
@flux-benj flux-benj force-pushed the scaledjob-paused-annotation branch from 2fe8ba5 to 348f197 Compare May 22, 2023 00:40
Copy link
Member

@tomkerkhove tomkerkhove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a few concerns, but nice work!

controllers/keda/util/predicate.go Outdated Show resolved Hide resolved
pkg/eventreason/eventreason.go Outdated Show resolved Hide resolved
config/crd/bases/keda.sh_scaledjobs.yaml Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
tests/internals/pause_scaledjob/pause_scaledjob_test.go Outdated Show resolved Hide resolved
@flux-benj flux-benj force-pushed the scaledjob-paused-annotation branch 2 times, most recently from cf20ec6 to a676efb Compare May 23, 2023 20:46
@tomkerkhove
Copy link
Member

tomkerkhove commented Jun 1, 2023

/run-e2e
Update: You can check the progress here

apis/keda/v1alpha1/scaledjob_types.go Show resolved Hide resolved
controllers/keda/scaledjob_controller.go Outdated Show resolved Hide resolved
controllers/keda/scaledjob_controller.go Outdated Show resolved Hide resolved
pkg/scaling/executor/scale_jobs.go Outdated Show resolved Hide resolved
Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be ideal to base the ScaledJob implementation on this ScaledObject approach:

#4550

@flux-benj flux-benj force-pushed the scaledjob-paused-annotation branch from a676efb to a99f8ea Compare June 11, 2023 22:16
@flux-benj
Copy link
Contributor Author

It would be ideal to base the ScaledJob implementation on this ScaledObject approach:

#4550

Agreed, this is a nice approach and have adopted it here. Relies on the client manager to check annotation events to re-run the reconcile logic.

@JorTurFer
Copy link
Member

JorTurFer commented Jun 17, 2023

/run-e2e internal
Update: You can check the progress here

@flux-benj flux-benj force-pushed the scaledjob-paused-annotation branch 2 times, most recently from 356050d to 24ecf33 Compare June 18, 2023 21:14
@JorTurFer
Copy link
Member

JorTurFer commented Jun 18, 2023

/run-e2e internal
Update: You can check the progress here

@JorTurFer
Copy link
Member

JorTurFer commented Jun 20, 2023

/run-e2e internal
Update: You can check the progress here

@zroubalik
Copy link
Member

zroubalik commented Jun 21, 2023

/run-e2e pause_scaledjob
Update: You can check the progress here

controllers/keda/scaledjob_controller.go Outdated Show resolved Hide resolved
controllers/keda/scaledjob_controller.go Outdated Show resolved Hide resolved
controllers/keda/scaledjob_controller.go Outdated Show resolved Hide resolved
controllers/keda/scaledjob_controller.go Show resolved Hide resolved
@flux-benj
Copy link
Contributor Author

I think the e2e tests are failing because the annotation command doesn't hit the namespace the test runs in, let me push a fix up for that.

--- Accreditation ---

Original PR: kedacore#3828

Borrows from the work originally implemented by: https://github.com/keegancwinchester

Note: I would have loved to have pulled the commit from the original branch, but I could not be able to.

Documentation MR by original implementor: kedacore/keda-docs#932

--- Fixes ---

Fixes # kedacore#3656

--- PR Notes ---

Introduce annotation to pause ScaledJobs.

Signed-off-by: BenJ <benjamin.jessop@fluxfederation.com>
@flux-benj flux-benj force-pushed the scaledjob-paused-annotation branch from 2766aea to c1980b4 Compare June 21, 2023 20:31
@JorTurFer
Copy link
Member

JorTurFer commented Jun 21, 2023

/run-e2e pause_scaledjob
Update: You can check the progress here

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, great job!

@zroubalik
Copy link
Member

@flux-benj could you please fix the changelog and also address the comment on the docs PR? Then we can go ahead and merge this PR.

Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
@zroubalik zroubalik merged commit d65e132 into kedacore:main Jun 22, 2023
18 of 19 checks passed
@flux-benj flux-benj deleted the scaledjob-paused-annotation branch June 22, 2023 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide support for explicitly pausing autoscaling of ScaledJobs
4 participants