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

Garbage collection for Update objects #733

Closed
EronWright opened this issue Oct 29, 2024 · 1 comment · Fixed by #810
Closed

Garbage collection for Update objects #733

EronWright opened this issue Oct 29, 2024 · 1 comment · Fixed by #810
Assignees
Labels
good-first-issue Start here if you'd like to start contributing to Pulumi impact/usability Something that impacts users' ability to use the product easily and intuitively kind/enhancement Improvements or new features resolution/fixed This issue was fixed

Comments

@EronWright
Copy link
Contributor

EronWright commented Oct 29, 2024

Update objects accumulate indefinitely in the system, and the operator should cleanup the old completed updates, e.g. after a week or so.

Should the Update controller handle the cleanup uniformly? Or should the Stack controller handle the cleanup for the updates that it owns? I would lean towards the former, by introducing a Update.spec.ttlSecondsAfterFinished field that the Stack controller may set and is implemented by the Update controller.

Verify that the output secret for a given update is cleaned up.

See https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/

@EronWright EronWright converted this from a draft issue Oct 29, 2024
@cleverguy25
Copy link

Added to epic #586

@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Oct 29, 2024
@EronWright EronWright added the good-first-issue Start here if you'd like to start contributing to Pulumi label Oct 29, 2024
@blampe blampe added kind/enhancement Improvements or new features impact/usability Something that impacts users' ability to use the product easily and intuitively and removed needs-triage Needs attention from the triage team labels Oct 29, 2024
EronWright added a commit that referenced this issue Feb 11, 2025
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md)
    for Pulumi's contribution guidelines.

    Help us merge your changes more quickly by adding more details such
    as labels, milestones, and reviewers.-->

### Proposed changes

<!--Give us a brief description of what you've done and what it solves.
-->
Implements a retention policy for completed Update objects, based on a
simple TTL with the default value of 24h. Update objects that are in a
completed state and are older than the TTL are summarily deleted.

#### New API: `Update.spec.ttlAfterCompleted` 

A new field to enable garbage collection of this update, once completed.
Optional; no default value.

#### Update Controller

Updated to implement the cleanup logic. When a TTL is set on a completed
update, the controller looks to the last transition time of the
Completed status condition. If there's time remaining, the controller
requeues the object for later, otherwise it deletes the update object.

#### Stack Controller

Updated to assign a 24-hour TTL on the update objects that it creates. A
future enhancement would be to provide an `updateTemplate` field to
allow for further control. A user may edit an existing Update to change
the TTL.

#### Update Controller Tests

A new unit test was added to exercise the retention logic.

### Related issues (optional)

<!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes
#1234'.
Or link to full URLs to issues or pull requests in other GitHub
repositories. -->

Closes #733
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Feb 11, 2025
@pulumi-bot pulumi-bot moved this from In Progress to Done in Pulumi Kubernetes Operator v2 Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Start here if you'd like to start contributing to Pulumi impact/usability Something that impacts users' ability to use the product easily and intuitively kind/enhancement Improvements or new features resolution/fixed This issue was fixed
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants