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.
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