Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(backup): update production sql backup to use s3 client #1092

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions k8s/helmfile/env/production/wbaas-backup.values.yaml.gotmpl
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
image:
repository: ghcr.io/wmde/wbaas-backup
tag: v0.2.0
tag: v0.3.0
pullPolicy: Always

job:
cronSchedule: "0 0 * * *"

scratchDiskSpace: 64Gi

storage:
scratchDiskSpace: 64Gi
gcs:
bucketName: wikibase-cloud-sql-backup
serviceAccountSecretName: api-serviceaccount
uploadToBucket: true
bucketName: wikibase-cloud-sql-backup
uploadToBucket: true

db:
load:
Expand Down
2 changes: 1 addition & 1 deletion k8s/helmfile/helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ releases:
- name: wbaas-backup
namespace: default
chart: wbstack/wbaas-backup
version: {{ ternary "0.1.0" "0.0.6" (ne .Environment.Name "production") }}
version: 0.1.0
<<: *default_release

- name: kube-prometheus-stack
Expand Down
24 changes: 24 additions & 0 deletions tf/env/production/secrets-gcs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
resource "google_service_account" "production-backup-upload" {
account_id = "production-backup-upload"
}

resource "google_storage_hmac_key" "production-backup-upload-key" {
service_account_email = google_service_account.production-backup-upload.email
}

resource "google_project_iam_member" "production-backup-upload" {
role = "roles/storage.admin"
member = "serviceAccount:${google_service_account.production-backup-upload.email}"
project = local.project_id
}

resource "kubernetes_secret" "gcs-hmac-key" {
provider = kubernetes.wbaas-3
metadata {
name = "gcs-hmac-key"
}
data = {
"access-key" = google_storage_hmac_key.production-backup-upload-key.access_id
"secret-key" = google_storage_hmac_key.production-backup-upload-key.secret
}
}