Open
Conversation
leafty
reviewed
Mar 27, 2026
d710128 to
008a000
Compare
ba76f86 to
ac5311e
Compare
will be replaced by MaxAge
no manual handling necessary. the job was previously recreated, because k8s removed the job, while the parent amaltheasession was still active and so it re-created it. now we must set the timeouts correctyl from the session spec so the jobs gets suspended when the session goes in hibernation and also not removed before the session is removed.
When the job is done (fail or success), the existing "idle time" property is used to schedule the deletion of the session.
d8ef15e to
16d5ec0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A session can now be either interactive (the default) or non-interactive which is indicated by a new property in the CRD:
sessionType. It is eitherInteractiveorNonInteractive.When a non-interactive session is requested, the session is not mapped to a stateful set, but to a job. Additionally, no
Serviceand noIngressis applied. The "hibernation" feature of a session is mapped to a suspended job.The session spec should contain the two timeouts used for non-interactive sessions:
MaxAgeandMaxHibernatedTime. The former is pushed into the jobsActiveDeadlineSecondsthat defines the maximum runtime. If that limit is reached, the job is tried to terminate and the session goes into "Hibernated" state. From there theMaxHibernatedTimefunctions the same as for interactive sessions: once this is reached, the session and all related resources are removed. This is done by setting theTTLSecondsAfterFinishedtimeout on the Job spec. It is important, that the job lifetime (ActiveDeadlineSeconds) is not shorter than the amalthea session, otherwise the session will re-create the job when it is removed by kubernetes due to this timeout.The overall amalthea status is derived from the associated Pod, which is assumed to be a single one. This is true for non-interactive sessions as well, as the config ensures only one pod running for the job. Then only the
GetPodfunction is adopted to return the Pod of the Job in case of a non-interactive session.