Skip to content

Add config to disable registry resources not required for executing migrations

What does this MR do?

As part of gitlab-org&17933, we are automating the execution of post deployment migrations (PDMs) for the Container Registry database. The idea is to execute PDMs independently of a deployment, by applying a Helm release that only runs pending migrations. Using a separate Helm release has several advantages; a migration failure will not affect the application Helm release, and it reduces the chances of unrelated changes sneaking into a helm apply that should have only executed migrations.

Since the registry chart does not have a separate sub-chart for executing migrations, we need to prevent Helm from creating K8s objects that are not directly related to executing migrations, when using a different Helm release for application deployment and for migration execution.

This MR adds a api.enabled boolean value to disable non-essential components in the registry chart and only execute migrations. This can be used to execute post deployment migrations after an application deployment, as an independent Helm release.

This disables the following templates:

  • deployment
  • hpa
  • pod disruption budget
  • service

Other resources can be disabled using existing helm values:

  • keda
  • networkpolicy
  • ingress
  • servicemonitor

The following templates will remain enabled:

  • migrations-job
  • configmap
  • serviceaccount

gitlab-com/gl-infra/delivery#21257 (closed)

Related issues

Author checklist

For general guidance, please follow our Contributing guide.

Required

For anything in this list which will not be completed, please provide a reason in the MR discussion.

  • Merge Request Title and Description are up to date, accurate, and descriptive.
  • MR targeting the appropriate branch.
  • MR has a green pipeline.
  • Documentation created/updated.
  • Tests added/updated, and test plan for scenarios not covered by automated tests.
  • Equivalent MR/issue for omnibus-gitlab opened.

Reviewers checklist

Edited by Reuben Pereira

Merge request reports

Loading