kedacore / keda

KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
https://keda.sh
Apache License 2.0
8.01k stars 1.01k forks source link

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

Open josefkarasek opened 2 weeks ago

josefkarasek commented 2 weeks ago

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

zroubalik commented 3 days ago

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