From 1f5e9751d52df2767c159fb5bc3b6e695b99810e Mon Sep 17 00:00:00 2001 From: Deniz Erdogan Date: Mon, 2 Sep 2024 16:18:16 +0200 Subject: [PATCH] fix primary --- k8s/jobs/singleWikiBackup.sh | 4 ++-- k8s/jobs/singleWikiRestore.sh | 2 +- k8s/jobs/singleWikiRestore.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/k8s/jobs/singleWikiBackup.sh b/k8s/jobs/singleWikiBackup.sh index ef6be4663..d35586bb6 100755 --- a/k8s/jobs/singleWikiBackup.sh +++ b/k8s/jobs/singleWikiBackup.sh @@ -9,8 +9,8 @@ fi # This creates the PVC (if it doesn't exist) for backups to be saved to # It will not be automatically deleted so you may need to clean this up when you are done -kubectl apply -f backUpSingleWikiPvc.yaml +kubectl apply -f singleWikiBackupPvc.yaml -kubectl create -f backUpSingleWiki.yaml -o=json --dry-run=client |\ +kubectl create -f singleWikiBackup.yaml -o=json --dry-run=client |\ jq ".spec.template.spec.containers[0].env += [{\"name\": \"DATABASE_NAME\", \"value\": \"${DATABASE_NAME}\"}]" |\ kubectl create -f - diff --git a/k8s/jobs/singleWikiRestore.sh b/k8s/jobs/singleWikiRestore.sh index ec6476f3c..7b0092a30 100755 --- a/k8s/jobs/singleWikiRestore.sh +++ b/k8s/jobs/singleWikiRestore.sh @@ -7,6 +7,6 @@ if [[ -z "$DATABASE_NAME" ]]; then exit 1 fi -kubectl create -f restoreSingleWiki.yaml -o=json --dry-run=client |\ +kubectl create -f singleWikiRestore.yaml -o=json --dry-run=client |\ jq ".spec.template.spec.containers[0].env += [{\"name\": \"DATABASE_NAME\", \"value\": \"${DATABASE_NAME}\"}]" |\ kubectl create -f - diff --git a/k8s/jobs/singleWikiRestore.yaml b/k8s/jobs/singleWikiRestore.yaml index bf5222119..248f39909 100644 --- a/k8s/jobs/singleWikiRestore.yaml +++ b/k8s/jobs/singleWikiRestore.yaml @@ -27,7 +27,7 @@ spec: - 'bash' - '-c' - | - mysql --host sql-mariadb-secondary.default.svc.cluster.local ${DATABASE_NAME} < /backup/${DATABASE_NAME}.sql + mysql --host sql-mariadb-primary.default.svc.cluster.local ${DATABASE_NAME} < /backup/${DATABASE_NAME}.sql volumeMounts: - name: temporary-backup-pvc mountPath: "/backup/"