application-migration

by joaquinito2051

Helm chartv1.2.15App 0.0.0

Job to run db migration for application before installing/upgrading new version

About this chart

application-migration

Chart that is responsible to run arbitrary jobs before deployment such as migration.

Usage

Add this chart as dependency to your application chart:

dependencies:
  - name: application-migration
    version: 0.0.0
    repository: "https://matic-insurance.github.io/helm-charts"
    alias: "migrations"

Chart using common global values that control application deployment:

global:
  application:
    product: olb
    environment: "staging"
    version: "1.2.3"

  applicationImage:
    repository: "maticinsurance/olb"

The command to run is configured vua command parameter

migrations:
  command: "rails db:migrate"

As result of above configuration helm will run command rails db:migrate in the docker image maticinsurance/olb:1.2.3 just before rolling out new deployment

Deploy application-migration with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has application-migration on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartapplication-migration is pinned at v1.2.15 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply