Assigning a Recipe
You can assign a recipe to your backup and restore operations.
- Assign a recipe with a backup policy assignment CR for backup and restore operations as follows:
- Assign a recipe for backup operations
- You can assign a recipe to an application or applications by specify the recipe in the PolicyAssignment CR to assign it to one or more applications. You can specify a single recipe in a PolicyAssignment CR.
- Assign a recipe for restore operations when restoring to the original namespace
- During a restore operation, a recipe must be started with the following precedence:
- If there is a Recipe CR with the same name and in the same namespace as the Recipe CR that was used during the backup operation, it must take precedence. It can be helpful in situations when you want to specify a different workflow or different hooks during the restore.
- If there is no Recipe CR with the same name and in the same namespace, the recipe that was used during the backup operation must be run. This information is stored as part of the backup metadata.
- Assign a recipe for restore operations when restoring to a different namespace
- If you are restoring to an alternative namespace, any namespaces that are specified in a hook cannot be run correctly as they refer to the original namespace. If you want the hooks to run in the alternative namespace, change the Recipe CR as mentioned in Assign a recipe for restore operations when restoring to the original namespace. So that any hook namespaces are referring to the alternative namespace.
- Assign a recipe CR with an application CR as follows:
- Working with application CRs for single namespace
- For applications that only has a single namespace, there are no changes that are required in the application CR to support a recipe. The recipe is associated with the application, in this case with the PoliyAssignment CR, as defined in the Assign a recipe for backup operations.
- Working with application CRs for applications that span multiple namespaces
- If you have an application that spans multiple namespaces and want to use a recipe for the application, you need to specify all of the namespaces included in the application that is in the application CR.