-
Notifications
You must be signed in to change notification settings - Fork 0
fix: add ttl to captain migration job #450
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
Conversation
Signed-off-by: Shawn Hsu <[email protected]>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a TTL to the Captain migration Kubernetes Job so completed Jobs are automatically cleaned up after one hour. Sequence diagram for Captain migration Job lifecycle with TTLsequenceDiagram
actor Developer
participant HelmChart
participant KubernetesAPI
participant CaptainMigrationJob
participant CaptainMigrationPod as Pod
participant TTLController
Developer->>HelmChart: Deploy release (includes captain-migration-job)
HelmChart->>KubernetesAPI: Apply CaptainMigrationJob manifest
KubernetesAPI->>CaptainMigrationJob: Create Job with ttlSecondsAfterFinished 3600
CaptainMigrationJob->>KubernetesAPI: Request Pod creation
KubernetesAPI->>CaptainMigrationPod: Create Pod
CaptainMigrationPod-->>CaptainMigrationJob: Report completion
CaptainMigrationJob-->>KubernetesAPI: Job status succeeded
KubernetesAPI-->>TTLController: Expose Job with ttlSecondsAfterFinished
TTLController-->>TTLController: Wait 3600 seconds after completion
TTLController->>KubernetesAPI: Delete CaptainMigrationJob and associated Pods
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Consider making
ttlSecondsAfterFinishedconfigurable viavalues.yaml(with a sensible default) rather than hard-coding3600, so different environments can tune how long completed jobs are retained.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider making `ttlSecondsAfterFinished` configurable via `values.yaml` (with a sensible default) rather than hard-coding `3600`, so different environments can tune how long completed jobs are retained.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 1 file
Signed-off-by: Shawn Hsu <[email protected]>
Summary by Sourcery
Enhancements:
Summary by cubic
Added a TTL to the captain migration Kubernetes Job so completed jobs auto-remove, reducing cluster noise. TTL is configurable via values.yaml (captain.migration.ttl) and defaults to 1 hour; aligns with AGH-874 to keep the job ephemeral.
Written for commit 261ba6a. Summary will update automatically on new commits.