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

feat: introduce retention policy support #3709

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

shreddedbacon
Copy link
Member

@shreddedbacon shreddedbacon commented Apr 15, 2024

General Checklist

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for inclusion in changelog

Database Migrations

  • If your PR contains a database migation, it MUST be the latest in date order alphabetically

Introducing retention policy support to Lagoon. This first iteration only contains Harbor and history based retention policy support.

Retention policy support allows platform owners to configure policies globally, organizationally, or directly on projects. Policy inheritance exists-ish, and a project will override organization, which will override global.

Harbor Policies

Harbor policies allow for retaining the Last Pulled number of images based on rules that can be defined. This allows platform owners to be able to write rules that could retain all images of a project for the last # pulled images. Or configure multiple rules based on doublestar pattern matching that Harbor uses to prune some images more aggressively than others.

Harbor policies are enforced when they are linked, unlinked, updated, or when a deployment reaches the final stages. It uses hooks on certain events, and then send messages to the remotes to inform their configured Harbor of any policy changes that are required.

This requires that the remote-controller be updated with support for receiving the retention policy payloads

History Policies

History policies allow for retaining the last X number of builds and tasks and associated files/logs for these. It is possible to configure this for COUNT, DAYS, MONTHS. This allows for platform owners to retain a small number of builds and tasks within an environment if they choose to.

History policies are enforced whenever a new task or build is created.

See the README for more information about retention policies.

@shreddedbacon shreddedbacon added this to the 2.21.0 milestone Jul 4, 2024
@shreddedbacon shreddedbacon force-pushed the retention-policies branch 2 times, most recently from cdd16b5 to 641862f Compare August 18, 2024 22:59
@shreddedbacon shreddedbacon modified the milestones: 2.21.0, 2.22.0 Aug 18, 2024
@shreddedbacon shreddedbacon force-pushed the retention-policies branch 2 times, most recently from ebca482 to d4fd21a Compare September 18, 2024 08:25
@shreddedbacon shreddedbacon force-pushed the retention-policies branch 3 times, most recently from 8949ac1 to 0d9b7cb Compare October 18, 2024 07:48
@shreddedbacon shreddedbacon force-pushed the retention-policies branch 2 times, most recently from 5916484 to d2cbcf4 Compare October 25, 2024 03:37
@shreddedbacon shreddedbacon modified the milestones: 2.22.0, 2.23.0 Oct 28, 2024
@tobybellwood tobybellwood modified the milestones: 2.23.0, 2.24.0 Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants