diff --git a/scripts/helmcharts/openreplay/templates/job.yaml b/scripts/helmcharts/openreplay/templates/job.yaml index b0ee31d01..37a1d0ccd 100644 --- a/scripts/helmcharts/openreplay/templates/job.yaml +++ b/scripts/helmcharts/openreplay/templates/job.yaml @@ -156,6 +156,34 @@ spec: mountPath: /opt/openreplay - name: dbmigrationscript mountPath: /opt/migrations/ + - name: vault-s3-upload + env: + - name: AWS_ACCESS_KEY_ID + value: "{{ .Values.global.s3.accessKey }}" + - name: AWS_SECRET_ACCESS_KEY + value: "{{ .Values.global.s3.secretKey }}" + - name: AWS_DEFAULT_REGION + value: "{{ .Values.global.s3.region }}" + - name: AWS_ENDPOINT + value: "{{ .Values.global.s3.endpoint }}" + image: amazon/aws-cli + command: + - /bin/bash + - -c + args: + - | + while true; do + [[ -f /opt/openreplay/vault_creds.txt ]] && { + aws s3 cp --endpoint ${AWS_ENDPOINT} /opt/openreplay/vault_creds.txt s3://static/vault/ + exit 0 + } || { + echo vault not yet initialized; + sleep 2 + }; + done + volumeMounts: + - name: shared + mountPath: /opt/openreplay {{- end }} - name: clickhouse image: yandex/clickhouse-client:21.9.4.35