Pre-snapshot and post-restore execution hooks for YugabyteDB.
Tested with: YugabyteDB version 2.17.0.0-b24 (deployed with Helm chart)
Instructions for deployment: https://docs.yugabyte.com/preview/deploy/kubernetes/
args: [pre | post ]
The arguments are explained below:
pre: invokes a pre-snapshot operation.
<master-addresses>: A comma-separated list of master IP addresses. Example: "10.240.0.195,10.240.0.141,10.240.0.38"
<db-name>: The name of the database.
post: invokes a post-restore operation.
<yugabyte-snapshot-UUID>: The unique identifier of the YugabyteDB snapshot that must be restored.
| Action/Operation | Supported Stages | Notes |
|---|---|---|
| Snapshot | pre | Create a snapshot on the desired database |
| Restore | post | Restore a database to state referenced by desired snapshot |
To add execution hook(s) for an instance of YugabyteDB, you will need to:
- Discover the application. Identify the namespace your YugabyteDB deployment is present in. Define the YugabyteDB application.
- Click the application instance. Under the "Execution Hooks" tab, Click "Add".
- Provide the appropriate operation ("Pre-snapshot" or "Post-restore"), the hook arguments, and a name for the hook. For example, a Pre-Snapshot hook invocation may have the arguments "pre 10.240.0.195,10.240.0.141,10.240.0.38 yb_demo".
- IMPORTANT: Add a Hook Filter. Since YugabyteDB contains master and tablet server processes, the execution hook must be run on a single pod. One option is to choose the "Pod name" Hook filter type. In this manner, the name of a YB Master pod can be provided.
- Define the script (
yugabyte-hooks.sh). - Repeat the steps for defining additional execution hooks.