-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Pre/Post hooks example. #795
Conversation
Signed-off-by: Wayne Witzel III <[email protected]>
d9b25e3
to
d32f8db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lgtm. I made super minor wording change suggestions. 👍
docs/hooks.md
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The to
here is extraneous.
docs/hooks.md
Outdated
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/the file system/it
docs/hooks.md
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/By placing Ark in restore only mode you prevent/This will prevent
docs/hooks.md
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Finally/Finally,
docs/hooks.md
Outdated
|
||
Now you patch your deployment 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"]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these commands should be wrapper in triple backticks, to make them code snippets.
3b1dd51
to
37853ba
Compare
Signed-off-by: Wayne Witzel III <[email protected]>
37853ba
to
030ea6c
Compare
docs/hooks.md
Outdated
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"]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could apply all of these annotations in a single kubectl
call, e.g. kubectl annotate pod a=b c=d ...
-- which I think would remove the need to flip ark into restore-only mode and back. I think that'd be preferable since although I get the restore-only mode thing, it distracts a little from the main point
b2d9e74
to
658c6d5
Compare
This probably addresses #245 as well. |
docs/hooks.md
Outdated
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 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/containr/container
docs/hooks.md
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/containr/container
Signed-off-by: Wayne Witzel III <[email protected]>
658c6d5
to
575c4dd
Compare
docs/hooks.md
Outdated
[1]: api-types/backup.md | ||
[2]: https://github.com/heptio/ark/blob/master/examples/nginx-app/with-pv.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just use examples/nginx-app/with-pv.yaml
-- makes things work properly with GH pages/multiple versions of the docs
otherwise I think LGTM |
Signed-off-by: Wayne Witzel III <[email protected]>
8cb6aee
to
a8c42ab
Compare
Merging since there's an LGTM and the other comments appear to have been addressed. |
Rolls up changes from vmware-tanzu#795 and vmware-tanzu#823 Signed-off-by: Nolan Brubaker <[email protected]>
This change puts docs from vmware-tanzu#795 and vmware-tanzu#823 on the live docs site. Signed-off-by: Nolan Brubaker <[email protected]>
Updates our pre/post hook docs and extends it with an fsfreeze example.