diff --git a/Chart.yaml b/Chart.yaml index 63f51fd..bf91532 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -2,6 +2,6 @@ apiVersion: v2 name: hasura description: A Helm chart for Kubernetes type: application -version: 0.1.12 +version: 0.2.0 appVersion: v2.3.1 icon: https://raw.githubusercontent.com/hasura/graphql-engine/master/assets/brand/powered_by_hasura_primary_lightbg.svg diff --git a/templates/migrations-job.yaml b/templates/migrations-job.yaml index 61dbbc3..5069139 100644 --- a/templates/migrations-job.yaml +++ b/templates/migrations-job.yaml @@ -1,4 +1,4 @@ -{{- if .Values.migrations.enabled }} +{{- if .Values.migrations.image.repository }} apiVersion: batch/v1 kind: Job metadata: @@ -20,32 +20,18 @@ spec: volumes: - name: data emptyDir: { } - - name: ssh-key - secret: - secretName: {{ quote .Values.migrations.git.sshKeySecret }} - defaultMode: 0400 initContainers: - - name: git-clone - image: {{ .Values.migrations.git.image }} - command: [ "/bin/sh", "-c" ] - args: - - set -ex; - if [ ! -d .git ]; then - git init --quiet; - git remote add origin {{ .Values.migrations.git.repo }}; - git fetch origin +refs/heads/{{ .Values.migrations.git.branch }}; - git checkout {{ .Values.migrations.git.commit }} -b {{ .Values.migrations.git.branch }}; - fi + - name: copy + image: "{{ .Values.migrations.image.registry }}/{{ .Values.migrations.image.repository }}:{{ .Values.migrations.image.tag | default "latest" }}" + command: + - cp + - -R + - * + - /shared/data workingDir: /data - env: - - name: GIT_SSH_COMMAND - value: ssh -i /.ssh/id_rsa -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes volumeMounts: - name: data - mountPath: /data - - name: ssh-key - readOnly: true - mountPath: '/.ssh' + mountPath: /shared-data containers: - name: migrate image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" diff --git a/values.yaml b/values.yaml index e6b7079..8bdf67d 100644 --- a/values.yaml +++ b/values.yaml @@ -13,13 +13,11 @@ image: extraEnvVarsSecret: "" migrations: - enabled: false - git: - image: alpine/git:v2.32.0 - sshKeySecret: "" - repo: "" - branch: master - commit: "" + # Docker image which contain migrations,metadata,config.yml inside /data directory + image: + registry: docker.io + repository: "" + tag: "" imagePullSecrets: [ ] nameOverride: ""