From 194f5a7326e1d5061684858c5f88ffa806a8a7b0 Mon Sep 17 00:00:00 2001 From: Sebastian Widmer Date: Fri, 16 Jul 2021 12:55:36 +0200 Subject: [PATCH 1/3] Use official, non-deprected mariadb image --- docs/modules/ROOT/examples/tutorial/mariadb/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/ROOT/examples/tutorial/mariadb/deployment.yaml b/docs/modules/ROOT/examples/tutorial/mariadb/deployment.yaml index 31b7145b2..c7f744603 100644 --- a/docs/modules/ROOT/examples/tutorial/mariadb/deployment.yaml +++ b/docs/modules/ROOT/examples/tutorial/mariadb/deployment.yaml @@ -20,7 +20,7 @@ spec: k8up.syn.tools/backupcommand: /bin/bash -c 'mysqldump -uroot -p"${MARIADB_ROOT_PASSWORD}" --all-databases' spec: containers: - - image: mariadb/server:10.4 + - image: mariadb:10.4 name: mariadb readinessProbe: timeoutSeconds: 1 From 2013da966a6184dd7aa9d864a1a9e5cfa562a083 Mon Sep 17 00:00:00 2001 From: Sebastian Widmer Date: Fri, 16 Jul 2021 12:59:09 +0200 Subject: [PATCH 2/3] Revert "Fix quoting" The enviroment should come from the pod, not from the shell. This reverts commit 223533ed87b4080b0f0545b44a3235d1ef26a165. --- docs/modules/ROOT/examples/tutorial/scripts/4_restore.sh | 2 +- docs/modules/ROOT/pages/tutorials/tutorial.adoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/modules/ROOT/examples/tutorial/scripts/4_restore.sh b/docs/modules/ROOT/examples/tutorial/scripts/4_restore.sh index deae2b2f7..af1fe43d6 100755 --- a/docs/modules/ROOT/examples/tutorial/scripts/4_restore.sh +++ b/docs/modules/ROOT/examples/tutorial/scripts/4_restore.sh @@ -19,4 +19,4 @@ SNAPSHOT_ID=$(restic snapshots --json --last --path /default-mariadb | jq -r '.[ # Restore MariaDB data MARIADB_POD=$(kubectl get pods -o custom-columns="NAME:.metadata.name" --no-headers -l "app=wordpress,tier=mariadb") -restic dump "${SNAPSHOT_ID}" /default-mariadb | kubectl exec -i "$MARIADB_POD" -- /bin/bash -c "mysql -uroot --password=\"${MARIADB_ROOT_PASSWORD}\"" +restic dump "${SNAPSHOT_ID}" /default-mariadb | kubectl exec -i "$MARIADB_POD" -- /bin/bash -c 'mysql -uroot --password="${MARIADB_ROOT_PASSWORD}"' diff --git a/docs/modules/ROOT/pages/tutorials/tutorial.adoc b/docs/modules/ROOT/pages/tutorials/tutorial.adoc index 9c0a58d2a..8c7213d7a 100644 --- a/docs/modules/ROOT/pages/tutorials/tutorial.adoc +++ b/docs/modules/ROOT/pages/tutorials/tutorial.adoc @@ -315,7 +315,7 @@ Instead of restoring files to a PVC, we can instead connect to the running datab .... $ export SNAPSHOT_ID=$(restic snapshots --json --last --path /default-mariadb | jq -r '.[0].id') $ export MARIADB_POD=$(kubectl get pods -o custom-columns="NAME:.metadata.name" --no-headers -l "app=wordpress,tier=mariadb") -$ restic dump "${SNAPSHOT_ID}" /default-mariadb | kubectl exec -i "$MARIADB_POD" -- /bin/bash -c "mysql -uroot --password=\"${MARIADB_ROOT_PASSWORD}\"" +$ restic dump "${SNAPSHOT_ID}" /default-mariadb | kubectl exec -i "$MARIADB_POD" -- /bin/bash -c 'mysql -uroot --password="${MARIADB_ROOT_PASSWORD}"' .... Now refresh your WordPress page in your browser window. You should see the previous state of the WordPress installation restored, working and looking as expected! From 6eb2de2a03b9ef29e5db863516e7b29cb3670435 Mon Sep 17 00:00:00 2001 From: Sebastian Widmer Date: Fri, 16 Jul 2021 13:09:37 +0200 Subject: [PATCH 3/3] Fix shellcheck for restore script --- docs/modules/ROOT/examples/tutorial/scripts/4_restore.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/modules/ROOT/examples/tutorial/scripts/4_restore.sh b/docs/modules/ROOT/examples/tutorial/scripts/4_restore.sh index af1fe43d6..71e409d54 100755 --- a/docs/modules/ROOT/examples/tutorial/scripts/4_restore.sh +++ b/docs/modules/ROOT/examples/tutorial/scripts/4_restore.sh @@ -19,4 +19,6 @@ SNAPSHOT_ID=$(restic snapshots --json --last --path /default-mariadb | jq -r '.[ # Restore MariaDB data MARIADB_POD=$(kubectl get pods -o custom-columns="NAME:.metadata.name" --no-headers -l "app=wordpress,tier=mariadb") +# the environment variable should come from the pod - not from the local shell. +# shellcheck disable=SC2016 restic dump "${SNAPSHOT_ID}" /default-mariadb | kubectl exec -i "$MARIADB_POD" -- /bin/bash -c 'mysql -uroot --password="${MARIADB_ROOT_PASSWORD}"'