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: clean up unused services and resources #274

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shreddedbacon
Copy link
Member

@shreddedbacon shreddedbacon commented Dec 2, 2023

This adds support for cleaning up unused services within an environment.

As Lagoon has typically not cleaned up in the past, this is a potentially dangerous operation in some cases. A user may be unaware that they may still be using or have an old service in their environment, and their application may still be using it.

There isn't any way to actually confirm if a service is still in used by an application during a build, so the action will be to warn and let the user decide on what action to take.

Maybe in the future removals will happen automatically and it will produce a warning still, but no choice in action.

Currently, this can detect and clean up any services, or dangling resources that a service created. In this case a typical service comprises of Kubernetes resources of the types Deployment, and then depending on the service, a Service and/or a PersistentVolumeClaim. A service can also be one of the DBaaS types.

Once the build has detected these, it will output the resources that would be removed and instruct what to do to have them removed. The user can verify the changes and make the decision to remove them in a future build, but also makes it clear that they need to verify that the resources are not used anymore before they are removed.

@shreddedbacon shreddedbacon force-pushed the cleanup-old-services branch 6 times, most recently from 1b83d72 to de56df8 Compare December 3, 2023 07:37
@shreddedbacon shreddedbacon added the enhancement New feature or request label Dec 21, 2023
@shreddedbacon shreddedbacon added the onhold pending other changes label Jan 14, 2024
@tobybellwood tobybellwood added this to the 2.20.0 milestone May 27, 2024
@shreddedbacon shreddedbacon removed this from the 2.20.0 milestone Jun 19, 2024
@shreddedbacon
Copy link
Member Author

This needs more work before it is ready for a release, so I've removed the milestone

@shreddedbacon shreddedbacon marked this pull request as ready for review June 20, 2024 22:23
@shreddedbacon shreddedbacon marked this pull request as draft June 20, 2024 22:24
@shreddedbacon shreddedbacon force-pushed the cleanup-old-services branch 14 times, most recently from 119f2bb to 116a828 Compare September 24, 2024 02:22
@shreddedbacon shreddedbacon removed the onhold pending other changes label Sep 24, 2024
@shreddedbacon shreddedbacon force-pushed the cleanup-old-services branch 6 times, most recently from 9f91f25 to ab1aba3 Compare September 26, 2024 23:59
@shreddedbacon shreddedbacon changed the title feat: initial pass at service cleanup feat: clean up unused services and resources Sep 27, 2024
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

Successfully merging this pull request may close these issues.

2 participants