From b2d9e746a5607eaf29fd4e581b3b3f62f331ca88 Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Mon, 27 Aug 2018 14:55:18 -0400 Subject: [PATCH] apply annotations on single line, no restore mode Signed-off-by: Wayne Witzel III --- docs/hooks.md | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/docs/hooks.md b/docs/hooks.md index ec0cea7323a..f933cf22598 100644 --- a/docs/hooks.md +++ b/docs/hooks.md @@ -59,29 +59,18 @@ 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 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. - -```shell -kubectl patch -n heptio-ark config default --type merge -p '{"restoreOnlyMode": true}' -``` - -Now you patch your pod with the required annotations. - ```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 \ + pre.hook.backup.ark.heptio.com/command='["/sbin/fsfreeze", "--freeze", "/var/log/nginx"]' + pre.hook.backup.ark.heptio.com/containr=fsfreeze + post.hook.backup.ark.heptio.com/command='["/sbin/fsfreeze", "--unfreeze", "/var/log/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 +Now 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. ```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