From 401ecfe80f30ca2734f9d8347b4b3d5fa76c9a5f Mon Sep 17 00:00:00 2001 From: Brutus5000 Date: Sun, 9 Feb 2025 10:38:17 +0100 Subject: [PATCH] Add faf-db-migrations cronjob --- apps/faf-db-migrations/Chart.yaml | 3 ++ apps/faf-db-migrations/templates/cronjob.yaml | 33 +++++++++++++++++++ apps/faf-db-migrations/templates/secret.yaml | 19 +++++++++++ 3 files changed, 55 insertions(+) create mode 100644 apps/faf-db-migrations/Chart.yaml create mode 100644 apps/faf-db-migrations/templates/cronjob.yaml create mode 100644 apps/faf-db-migrations/templates/secret.yaml diff --git a/apps/faf-db-migrations/Chart.yaml b/apps/faf-db-migrations/Chart.yaml new file mode 100644 index 0000000..c730429 --- /dev/null +++ b/apps/faf-db-migrations/Chart.yaml @@ -0,0 +1,3 @@ +apiVersion: v2 +name: faf-db-migrations +version: 1.0.0 diff --git a/apps/faf-db-migrations/templates/cronjob.yaml b/apps/faf-db-migrations/templates/cronjob.yaml new file mode 100644 index 0000000..83de467 --- /dev/null +++ b/apps/faf-db-migrations/templates/cronjob.yaml @@ -0,0 +1,33 @@ +kind: CronJob +apiVersion: batch/v1 +metadata: + name: faf-db-migrations + namespace: faf-apps + labels: + app: faf-db-migrations +spec: + # Disabled because triggered manually + schedule: "0 0 31 2 *" + suspend: true + concurrencyPolicy: Forbid + jobTemplate: + metadata: + labels: + app: faf-db-migrations + annotations: + prometheus.io/scrape: 'false' + spec: + template: + spec: + containers: + - image: faforever/faf-db-migrations:v133 + imagePullPolicy: Always + name: faf-db-migrations + env: + - name: FLYWAY_URL + value: "jdbc:mariadb://mariadb:3306/faf_lobby?ssl=false" + envFrom: + - secretRef: + name: faf-db-migrations + args: [ "migrate" ] + restartPolicy: Never diff --git a/apps/faf-db-migrations/templates/secret.yaml b/apps/faf-db-migrations/templates/secret.yaml new file mode 100644 index 0000000..7f2736b --- /dev/null +++ b/apps/faf-db-migrations/templates/secret.yaml @@ -0,0 +1,19 @@ +apiVersion: secrets.infisical.com/v1alpha1 +kind: InfisicalSecret +metadata: + name: faf-db-migrations + namespace: faf-apps +spec: + authentication: + universalAuth: + credentialsRef: + secretName: infisical-machine-identity + secretNamespace: faf-ops + secretsScope: + projectSlug: {{.Values.infisical.projectSlug}} + envSlug: {{.Values.infisical.envSlug}} + secretsPath: "/faf-db-migrations" + managedSecretReference: + secretName: faf-db-migrations + secretNamespace: faf-apps + creationPolicy: "Owner"