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

Clean up expiring namespaces #161

Open
shreddedbacon opened this issue Aug 11, 2022 · 4 comments
Open

Clean up expiring namespaces #161

shreddedbacon opened this issue Aug 11, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@shreddedbacon
Copy link
Member

During migrations of environments from one target to another, the old namespace remains in the old target after migrations are performed, and could be forgotten about.

It could be useful to scan namespaces for a label like lagoon.sh/expiration=${timestamp} and then perform a deletion of that namespace.

@shreddedbacon shreddedbacon added the enhancement New feature or request label Aug 11, 2022
@shreddedbacon
Copy link
Member Author

Some ideas for labels:

  • lagoon.sh/forceExpire=true could delete the namespace as soon as the next cleanup job runs
  • lagoon.sh/expiration=${timestamp} could delete the namespace on the next cleanup after this expiration date

We could also have configurable warning message too for a period in advance of the expiration date to say that the namespace will be removed.

In some cases development environments could be removed after a defined period too, and the expiration could be incremented after each deployment to ensure it remains active for a period of time.

@shreddedbacon
Copy link
Member Author

@bomoko looping you in here for ideas

@bomoko
Copy link
Contributor

bomoko commented Aug 31, 2022

@shreddedbacon - I'm very happy with any and all of these suggestions.

Perhaps as a start we can start with the simple lagoon.sh/expiration=${timestamp} case.

@shreddedbacon
Copy link
Member Author

Since Lagoon namespace tokens can't label the namespace, but a task in Lagoon that performs migrations may need a way to mark an old namespace as ready for removal, there needs to be a way to mark a namespace as expired via something like a kind: Secret or kind: Configmap that contains the expiration timestamp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants