mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-08-15 19:56:06 +00:00
minor word updates and command wrapping
Signed-off-by: Wayne Witzel III <wayne@riotousliving.com>
This commit is contained in:
+20
-14
@@ -59,28 +59,34 @@ setup this example.
|
||||
The Ark [example/nginx-app/with-pv.yaml][2] serves as an example of adding the pre and post hook annotations directly
|
||||
to your declarative deployment. Below is an example of what updating an object in place might look like.
|
||||
|
||||
Place Ark in to restore only mode. By placing Ark in restore only mode you prevent Ark backups from running
|
||||
while you are adding the annotations and avoid the condition where the pre hook freezes the file system, but
|
||||
there is no post hook setup to unfreeze the file system.
|
||||
Place Ark in restore only mode. This will prevent Ark backups from running while you are adding the
|
||||
annotations and avoid the condition where the pre hook freezes the file system, but there is no
|
||||
post hook setup to unfreeze it.
|
||||
|
||||
kubectl patch -n heptio-ark config default --type merge -p '{"restoreOnlyMode": true}'
|
||||
```shell
|
||||
kubectl patch -n heptio-ark config default --type merge -p '{"restoreOnlyMode": true}'
|
||||
```
|
||||
|
||||
Now you patch your deployment with the required annotations.
|
||||
Now you patch your pod with the required annotations.
|
||||
|
||||
kubectl annotate pod -n nginx-example -l app=nginx pre.hook.backup.ark.heptio.com/command='["/sbin/fsfreeze", "--freeze", "/var/log/nginx"]'
|
||||
kubectl annotate pod -n nginx-example -l app=nginx pre.hook.backup.ark.heptio.com/containr=fsfreeze
|
||||
```shell
|
||||
kubectl annotate pod -n nginx-example -l app=nginx pre.hook.backup.ark.heptio.com/command='["/sbin/fsfreeze", "--freeze", "/var/log/nginx"]'
|
||||
kubectl annotate pod -n nginx-example -l app=nginx pre.hook.backup.ark.heptio.com/containr=fsfreeze
|
||||
|
||||
kubectl annotate pod -n nginx-example -l app=nginx post.hook.backup.ark.heptio.com/command='["/sbin/fsfreeze", "--unfreeze", "/var/log/nginx"]'
|
||||
kubectl annotate pod -n nginx-example -l app=nginx post.hook.backup.ark.heptio.com/containr=fsfreeze
|
||||
kubectl annotate pod -n nginx-example -l app=nginx post.hook.backup.ark.heptio.com/command='["/sbin/fsfreeze", "--unfreeze", "/var/log/nginx"]'
|
||||
kubectl annotate pod -n nginx-example -l app=nginx post.hook.backup.ark.heptio.com/containr=fsfreeze
|
||||
```
|
||||
|
||||
Finally remove Ark from restore only mode and test the pre and post hooks by creating a backup. You can use the Ark logs to verify that the pre and post
|
||||
Finally, remove Ark from restore only mode and test the pre and post hooks by creating a backup. You can use the Ark logs to verify that the pre and post
|
||||
hooks are running and exiting without error.
|
||||
|
||||
kubectl patch -n heptio-ark config default --type merge -p '{"restoreOnlyMode": false}'
|
||||
ark backup create nginx-hook-test
|
||||
```shell
|
||||
kubectl patch -n heptio-ark config default --type merge -p '{"restoreOnlyMode": false}'
|
||||
ark backup create nginx-hook-test
|
||||
|
||||
ark backup get nginx-hook-test
|
||||
ark backup logs nginx-hook-test | grep hookCommand
|
||||
ark backup get nginx-hook-test
|
||||
ark backup logs nginx-hook-test | grep hookCommand
|
||||
```
|
||||
|
||||
|
||||
[1]: api-types/backup.md
|
||||
|
||||
Reference in New Issue
Block a user