Skip to content

Commit

Permalink
Merge pull request #460 from vshn/improve-tutorial
Browse files Browse the repository at this point in the history
Validate tutorial
  • Loading branch information
bastjan authored Jul 23, 2021
2 parents df7435b + 6eb2de2 commit 7b47bcd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion docs/modules/ROOT/examples/tutorial/scripts/4_restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
restic dump "${SNAPSHOT_ID}" /default-mariadb | kubectl exec -i "$MARIADB_POD" -- /bin/bash -c "mysql -uroot --password=\"${MARIADB_ROOT_PASSWORD}\""
# 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}"'
2 changes: 1 addition & 1 deletion docs/modules/ROOT/pages/tutorials/tutorial.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down

0 comments on commit 7b47bcd

Please sign in to comment.