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

[BUG-5656] Annotate Jobs with parent ScaledJob generation #5876

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

josefkarasek
Copy link
Member

@josefkarasek josefkarasek commented Jun 10, 2024

As reported in #5656, keda-operator Pod restart causes the deletion of existing Jobs (child resources of ScaledJob). The Jobs are re-created immediately, but the state/progress of the running Jobs is lost.

My approach to fixing this is to maintain relation between the ScaledJob and child Jobs using an Annotation:
"scaledjob.keda.sh/generation": $(ScaledJob.Generation)
This way the operator, during startup, will only delete Jobs with "scaledjob.keda.sh/generation" that doesn't match the generation of the parent ScaledJob.

Checklist

Fixes #5656

@josefkarasek josefkarasek marked this pull request as ready for review June 17, 2024 09:15
@josefkarasek josefkarasek requested a review from a team as a code owner June 17, 2024 09:15
@josefkarasek josefkarasek changed the title Annotate Jobs with parent ScaledJob generation [BUG-5656] Annotate Jobs with parent ScaledJob generation Jun 17, 2024
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, thanks! Could you please also update changelog?

pkg/scaling/executor/scale_jobs.go Outdated Show resolved Hide resolved
@zroubalik
Copy link
Member

zroubalik commented Jun 25, 2024

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

zroubalik

This comment was marked as outdated.

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.

@josefkarasek the static check si failing on the Changelog entry, it needs to be alphabetically sorted, also please move this into Improvements section - it is an user-facing issue.

The rest looks good, thanks

@zroubalik zroubalik self-requested a review June 25, 2024 19:51
Signed-off-by: Josef Karasek <josef@kedify.io>
Signed-off-by: Josef Karasek <josef@kedify.io>
Signed-off-by: Josef Karasek <josef@kedify.io>
Signed-off-by: Josef Karasek <josef@kedify.io>
Signed-off-by: Josef Karasek <josef@kedify.io>
Signed-off-by: Josef Karasek <josef@kedify.io>
Signed-off-by: Josef Karasek <josef@kedify.io>
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.

Restart of keda-operator causes ScaledJob object to be updated
2 participants