Skip to content

Epic: [installer] Rollout migrations first #12886

@geropl

Description

@geropl

Problem

Currently, installer render renders all YAML files for all components. If they are applied in one step (as it's currently the case for A Self-Hosted installations as well as B current ArgoCD applications), migrations and code changes are applied in parallel. Depending on timings, this might cause code to hit an unprepared DB, which might end up in all kind of user-errors.

Situation

So far, this was not an issue because:

  • A Self-Hosted installation history is not that long so migrations were near-instant
  • B SaaS is using separate deploy jobs which handle migrations.

Motivation

The SaaS handling is suboptimal in terms of complexity introduced, and we would love to move to a pure ArgoCD-setup without multiple layers of external wrappers.

Also, there might be a chance to solve this problem for Self-Hosted (which will become more apparent as SH installations grow and age) with the same/similar approach.

Suggested solution(s)

1. Use "hook" concepts

Helm - which we already use internally in the installer - as well as ArgoCD have the concept of using "hooks", which are designed to handle exactly that case.

We could:

  1. make installer render the migration job with these annotations:
annotations:
    argocd.argoproj.io/hook: PreSync
    "helm.sh/hook": pre-install,pre-upgrade
    "helm.sh/hook-weight": "-1"
    "helm.sh/hook-delete-policy": hook-succeeded
  1. B ArgoCD: Make sure ArgoCD is configured to stop on a failed PreSync hook
  2. A Self-Hosted: Could use helm to apply the new yaml (are we already doing this? 🤔 )

2. ???

Next steps

  1. Clarify if Team Self-Hosted sees benefit here, and if it's worth tackling now
    1. also depends on: Are we already using helm to apply the new yaml? If yes, this might be a no-brainer
  2. Check with Team Platform if they agree on the use of the PreSync hook

@mads-hartmann @corneliusludmann

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    In Validation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions