Restoring the Policy Workbench for AWS
Before you begin
Before starting a restore, ensure that the following prerequisites are met:
An existing backup is available. Backups are taken automatically as part of the default installation of the Policy Workbench using scheduled backup mechanisms. The backups are available in the encrypted AWS S3 bucket that you created when you deployed PPW. You can also manually back up the data.
For more information about the AWS S3 bucket, refer to the section Creating AWS KMS Key and S3 Bucket.
For more information about manually backing up the data, refer to the section Backing up the Policy Workbench for AWS.
A restored PPC cluster is available. The Policy Workbench is restored on a restored PPC cluster. For information about restoring the PPC, refer to the section Restoring the PPC for AWS.
Note: You can restore the Policy Workbench without first restoring the PPC if only the Policy Workbench is corrupted.
Important: Before you restore the data, ensure that Velero CLI version 1.18 or later is installed.
Restore the Policy Workbench data
To restore the data:
Ensure that the
main.tffile in the root module, which is the working directory for executing the OpenTofu commands, contains the following code block. If the root module is not available, create a root module with themain.tffile.module "policy_workbench" { source = "oci://<Container_Registry_Path>/policy-workbench/opentofu/modules/policy-workbench/<cloud>?tag=<version>" cluster_name = var.cluster_name } variable "cluster_name" { type = string description = "EKS cluster name." nullable = false validation { condition = length(trimspace(var.cluster_name)) > 0 error_message = "cluster_name must be provided and cannot be empty." } }This code block adds the Policy Workbench OpenTofu module.
Run the following commands on the jump box.
Note: You do not need to run these commands if you only uninstall PPW and delete the namespace. These commands are required if you destroy the PPW cluster using
tofu destroy. They are also required if you are restoring to a new PPC cluster where PPW was not previously installed.tofu init tofu plan -var="cluster_name=<Restored-PPC-cluster-name>" tofu apply -var="cluster_name=<Restored-PPC-cluster-name>"Specify the name of the restored PPC cluster as the value of the
cluster_namevariable.For information about restoring the PPC, refer to the section Restoring the PPC for AWS.
Run the following command on the jump box.
velero restore create workbench-restore-$(date +%Y%m%d-%H%M%S) \ --from-backup <backup-name> \ -n pty-backup-recovery --waitFor example:
velero restore create workbench-restore-$(date +%Y%m%d-%H%M%S) \ --from-backup workbench-backup-schedule-20260331094735 \ -n pty-backup-recovery --waitFor more information about the
velero restorecommand, refer to the section Restore Reference in the Velero documentation.Run the following command to list all the restore operations in the specific namespace.
velero restore get -n pty-backup-recoveryEnsure that the status of the restore operation is
WaitingForPluginOperations.Run the following command to annotate the Kubernetes resources.
kubectl annotate productconfiguration workbench -n pty-admin kopf.zalando.org/last-handled-configuration- --overwriteThe following output appears if the annotation is added successfully.
productconfiguration.pty.com/workbench annotatedRun the following commands to monitor the restore status.
Run the following command to retrieve the list of existing restores.
velero restore get -n pty-backup-recoveryRun the following command to obtain details of a specific restore.
velero restore describe workbench-restore-<timestamp> -n pty-backup-recoveryRun the following command to obtain the log details for a specific restore.
velero restore logs workbench-restore-<timestamp> -n pty-backup-recoveryNote: Verify that the log output contains no entries with
level=error. Entries withlevel=warningare acceptable and do not indicate a restore failure.
Uninstall Policy Workbench before restoring on the same cluster
Note: Perform these steps only if you are restoring the Policy Workbench on the same cluster where it was previously installed. If you are restoring to a new cluster, skip this section.
Uninstall the policy-workbench module from the existing PPC cluster by running the following command on the jump box:
helm uninstall policy-workbench -n <namespace>For example:
helm uninstall policy-workbench -n policy-workbenchThe following output appears if the module is uninstalled successfully:
release "policy-workbench" uninstalledDelete the namespace where the Policy Workbench is installed by running the following command on the jump box:
kubectl delete namespace <namespace>For example:
kubectl delete namespace policy-workbenchThe following output appears if the namespace is deleted successfully:
namespace "policy-workbench" deleted
Feedback
Was this page helpful?