Support MR-based GitOps-style automated review environments

Release notes

Problem to solve

As a Software Developer, I want to deploy a review environment into a review Kubernetes cluster without writing any YAML using the processes set up by our Platform team.

As a Platform Engineer, I want to enable developers to automatically deploy a review application to K8s when they open an MR and remove that application when the MR is merged or closed. I want to use GitOps for the deployment.

Not in scope

As a Platform Engineer, I want to enable developers to automatically deploy a review application to K8s when they start a new branch and remove that application when the branch is deleted. I want to use GitOps for the deployment.

Requirements

  • Use the most recently built image in the MR pipeline.
  • Optionally, create a dedicated namespace and service account for every MR.
  • When MR is opened, generate a single YAML describing a Flux HelmRelease or Kustomization following a predefined template, and some variables passed from the MR context that can be reused in the YAML.
  • The template could be defined at the project level, under .gitlab/environment-templates/review.yaml.
  • The YAML does not need to exist in git, but GitLab should track it to remove it when the MR is merged or closed. The MR should show the YAML (a string reference to it is fine).
  • The "YAML" needs to be re-generated on pipeline run if it does not exist. (e.g. the environment was stopped on Friday evening, and needs to be restarted on Monday).
  • The deployed review app should show up under services/environments preferably without any further configuration.

Proposal

Intended users

Feature Usage Metrics

  • MAU starting a review environment
  • number review environments started
  • lifetime of a review environment (in hours)
  • number of agents configured for review environments
  • number of projects with a review environment template

Does this feature require an audit event?

References

This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.

Edited by Viktor Nagy (GitLab)