One of the simplest solutions I’ve used for managing temporal (ephemeral) environments is the solution provided by Flux Operator.

The configuration is straightforward and offers an out-of-the-box solution that can describe even complex environments. This setup makes environments available for a merge request and, at the same time, provides fast termination and cleanup of resources.

Read the docs: ResourceSets for GitLab Merge Requests →