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

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.

1 participant