Skip to content

Commit

Permalink
Merge pull request #185 from tayalrishabh96/feat/devtron-backup
Browse files Browse the repository at this point in the history
fix: devtron-backup helm chart for GCP
  • Loading branch information
prakarsh-dt authored Aug 10, 2023
2 parents a03ac09 + a2782e8 commit f7b5a34
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/devtron-backups/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v2
appVersion: "1.0"
description: A Helm chart for Devtron Backups
name: devtron-backups
version: 0.1.5
version: 0.1.6
12 changes: 6 additions & 6 deletions charts/devtron-backups/templates/backup-on-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec:
- name: GCS_BUCKET
value: "gs://{{ .GCS_BUCKET_NAME }}"
{{- if .CREDENTIALS.enabled }}
- name: gcp-credentials
- name: gcp_credentials
valueFrom:
secretKeyRef:
name: gcp-credentials
Expand All @@ -65,9 +65,9 @@ spec:
- /bin/bash
- -c
{{- if $.Values.global.GCP.encryption.enabled }}
- date1=$(date +%Y%m%d-%H%M); gpg -c --batch --passphrase {{ .Values.global.GCP.encryption.passphrase }} /tmp/backup.tar; rm -rvf /tmp/backup.tar; mv /tmp/backup.tar.gpg /tmp/backup-$date1.tar.gpg; gcloud storage cp /tmp/backup-$date1.tar.gpg $GCS_BUCKET/postgres/;
- echo $gcp_credentials > /tmp/gcp_credentials.json ; gcloud auth activate-service-account --key-file=/tmp/gcp_credentials.json ; date1=$(date +%Y%m%d-%H%M); gpg -c --batch --passphrase {{ .Values.global.GCP.encryption.passphrase }} /tmp/backup.tar; rm -rvf /tmp/backup.tar; mv /tmp/backup.tar.gpg /tmp/backup-$date1.tar.gpg; gcloud storage cp /tmp/backup-$date1.tar.gpg $GCS_BUCKET/postgres/;
{{- else}}
- date1=$(date +%Y%m%d-%H%M); mv /tmp/backup.tar /tmp/backup-$date1.tar; gcloud storage cp /tmp/backup-$date1.tar $GCS_BUCKET/postgres/;
- echo $gcp_credentials > /tmp/gcp_credentials.json ; gcloud auth activate-service-account --key-file=/tmp/gcp_credentials.json ; date1=$(date +%Y%m%d-%H%M); mv /tmp/backup.tar /tmp/backup-$date1.tar; gcloud storage cp /tmp/backup-$date1.tar $GCS_BUCKET/postgres/;
{{- end }}
volumes:
- name: psql-volume
Expand Down Expand Up @@ -123,7 +123,7 @@ spec:
- name: GCS_BUCKET
value: "gs://{{ .GCS_BUCKET_NAME }}"
{{- if .CREDENTIALS.enabled }}
- name: gcp-credentials
- name: gcp_credentials
valueFrom:
secretKeyRef:
name: gcp-credentials
Expand All @@ -135,9 +135,9 @@ spec:
- /bin/bash
- -c
{{- if $.Values.global.GCP.encryption.enabled }}
- date1=$(date +%Y%m%d-%H%M); gpg -c --batch --passphrase {{ .Values.global.GCP.encryption.passphrase }} /cache/backup.yaml; rm -rvf /cache/backup.yaml; mv /cache/backup.yaml.gpg /cache/backup-$date1.yaml.gpg; gcloud storage cp /cache/backup-$date1.yaml.gpg $GCS_BUCKET/argocd/;
- echo $gcp_credentials > /tmp/gcp_credentials.json ; gcloud auth activate-service-account --key-file=/tmp/gcp_credentials.json ; date1=$(date +%Y%m%d-%H%M); gpg -c --batch --passphrase {{ .Values.global.GCP.encryption.passphrase }} /cache/backup.yaml; rm -rvf /cache/backup.yaml; mv /cache/backup.yaml.gpg /cache/backup-$date1.yaml.gpg; gcloud storage cp /cache/backup-$date1.yaml.gpg $GCS_BUCKET/argocd/;
{{- else}}
- date1=$(date +%Y%m%d-%H%M); mv /cache/backup.yaml /cache/backup-$date1.yaml; gcloud storage cp /cache/backup-$date1.yaml $GCS_BUCKET/argocd/;
- echo $gcp_credentials > /tmp/gcp_credentials.json ; gcloud auth activate-service-account --key-file=/tmp/gcp_credentials.json ; date1=$(date +%Y%m%d-%H%M); mv /cache/backup.yaml /cache/backup-$date1.yaml; gcloud storage cp /cache/backup-$date1.yaml $GCS_BUCKET/argocd/;
{{- end }}
volumes:
- name: argocd-volume
Expand Down
2 changes: 1 addition & 1 deletion charts/devtron-backups/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ global:

encryption:
enabled: false # Recommended
passphrase: ""
passphrase: "" # Required if encryption is enabled

argocdversion: v2

Expand Down

0 comments on commit f7b5a34

Please sign in to comment.