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

ScaledJob: introduce rolloutStrategy #2164

Merged
merged 14 commits into from
Nov 1, 2021

Conversation

etamarw
Copy link
Contributor

@etamarw etamarw commented Oct 6, 2021

This pr should fix / add features as described on this issue: #2098

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO - learn more)
  • A PR is opened to update the documentation on (repo) (if applicable)
  • Changelog has been updated

Fixes #

I've added the field rolloutStrategy (gradual / immediate - the default). it lets the user to choose whether to redeploy all running jobs created by the previous version of the scalejob or to rollout new changes gradually. means only new jobs will contain the latest changes, and already running jobs wont get deleted.
also, i fixed the bug we had with returning the number of jobs the controller deletes.

its my first contribution over here so i really need a code review :)

Signed-off-by: etamarw <etamarw@wix.com>
Signed-off-by: etamarw <etamarw@wix.com>
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.

Looking good, please run make build & make manifests to also include regenerated CRDs and deepcopy objects.

@zroubalik zroubalik changed the title Etamar/rollout strategy ScaledJob: introduce rolloutStrategy Oct 11, 2021
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.

Looking good, do you think that you can add an unit test for this feature? Similar to ScaledObject one: https://github.com/kedacore/keda/blob/main/controllers/keda/scaledobject_controller_test.go

And update documentation: https://keda.sh/docs/2.5/concepts/scaling-jobs/

config/crd/bases/keda.sh_scaledobjects.yaml Outdated Show resolved Hide resolved
@zroubalik
Copy link
Member

@TsuyoshiUshio PTAL :)

@zroubalik zroubalik added this to the v2.5.0 milestone Oct 12, 2021
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 Outdated Show resolved Hide resolved
controllers/keda/scaledjob_controller.go Outdated Show resolved Hide resolved
@zroubalik
Copy link
Member

@etamarw any update on this please?

@etamarw
Copy link
Contributor Author

etamarw commented Oct 20, 2021

sorry for the latency, had a really busy week. ill try to push relevant changes in the next few days.

@zroubalik
Copy link
Member

@etamarw no problem :) It would be nice to include this change into the next release which will be in (~3 weeks), so you have some time, no need to rush. Thanks!

etamarw and others added 6 commits October 20, 2021 19:10
Signed-off-by: etamarw <etamarw@wix.com>
Signed-off-by: etamarw <etamarw@wix.com>
Co-authored-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
Signed-off-by: etamarw <etamarw@wix.com>
Co-authored-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
Signed-off-by: etamarw <etamarw@wix.com>
Signed-off-by: etamarw <etamarw@wix.com>
Signed-off-by: etamarw <etamarw@wix.com>
Copy link
Contributor

@TsuyoshiUshio TsuyoshiUshio left a comment

Choose a reason for hiding this comment

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

Thank you! It is very good contribution! I love your idea! I leave only one comment for @zroubalik check.

config/crd/bases/keda.sh_scaledjobs.yaml Show resolved Hide resolved
Signed-off-by: etamarw <etamarw@wix.com>
Signed-off-by: etamarw <etamarw@wix.com>
@etamarw etamarw requested a review from arschles October 25, 2021 17:42
@etamarw
Copy link
Contributor Author

etamarw commented Oct 25, 2021

@zroubalik please make sure that i restored all of the relevant files.

@zroubalik
Copy link
Member

@etamarw looking good, could you please resolve the conflict in go.mod and add entry to the changelog (Unreleased, New section?

Signed-off-by: etamarw <etamarw@wix.com>
Copy link
Contributor

@arschles arschles left a comment

Choose a reason for hiding this comment

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

this looks great @etamarw 👍

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.

@etamarw Looking good, the last thing is missing is to document this feature in here: https://github.com/kedacore/keda-docs/blob/master/content/docs/2.5/concepts/scaling-jobs.md

CHANGELOG.md Outdated Show resolved Hide resolved
@etamarw
Copy link
Contributor Author

etamarw commented Oct 30, 2021

pr to the docs repo: kedacore/keda-docs#563

etamarw and others added 2 commits October 30, 2021 17:28
Co-authored-by: Zbynek Roubalik <726523+zroubalik@users.noreply.github.com>
Signed-off-by: etamarw <etamarw@wix.com>
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.

4 participants