Restoring Google Kubernetes Engine applications
R‑Cloud enables you to restore a whole application or only individual application items to a specific point in time.
Prerequisites
Only if you plan to specify post-restore scripts.
- The script must be located in a bucket to which the HMSA has access.
- The
#!/usr/bin/env python3
header must be specified in the script. -
The following line of code must be present in the script:
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = '/tmp/hycu/serviceAccount.json'
Limitations
-
Using the Restore Storage option is supported only for applications using persistent volumes.
- If your data is stored as a snapshot, you cannot restore it to a different source.
-
Only if you plan to specify post-restore scripts.
- Only Python scripts are supported.
-
For making API calls, you can use only the following Python libraries:
googleapiclient
for Google Cloud API callskubernetes
for Kubernetes API calls
Depending on how you want to restore data, do one of the following:
I want to... | Restore option | Instructions |
---|---|---|
Restore application storage together with all resource objects that are associated with the application to the original or a different location. | Restore Whole Application | Restoring a whole application |
Restore application storage to the original or a different location. | Restore Storage | Restoring storage |
Restore specific resource objects to the original or a different location. | Restore Resource Objects | Restoring resource objects |
To access the Applications panel, in the navigation pane, click Applications.
Restoring a whole application
You can restore a whole application to its original or a different location by restoring application storage together with all resource objects that are associated with the application.
Procedure
-
In the Applications panel, click the application that you want to restore. The Detail view appears at the bottom of the screen.
Note The Detail view appears only if you click an application. Selecting the check box before the name of the application will not open the Detail view.
- In the Detail view, select the preferred restore point, and then click Restore. The Application Restore dialog box opens.
- Select Restore Whole Application, and then click Next.
-
From the Restore from drop-down menu, select which tier you want to use for the restore. Your restore point can contain one or more tiers among which you can select:
- Automatic: This option ensures the fastest and most cost-effective restore.
- Backup (Snapshot)
- Backup (Target)
- Copy
- Archive—(daily, weekly, monthly, yearly)
- From the Target cluster drop-down menu, select the cluster to which you want to restore the application. You can select only among the clusters that are in the same region as the application. By default, the original cluster of the application is selected.
- From the Target namespace drop-down menu, select the namespace to which you want to restore the application. The original namespace of the application is preselected.
- Use the Keep original configuration switch if you want to keep the existing resource object configuration. If you disable the switch, the resource object configuration will be overwritten (including persistent volumes).
-
Optional. In the Post-restore script field, enter the path to the script that R‑Cloud should run after the restore.
Important When entering the path to the script, make sure to enter it correctly, including lowercase and uppercase letters, as the path is case sensitive. You must specify the path in the following format:
gs://<PathtoBucket>/script.py parameter1 parameter2 ...
Example The following is an example of the first lines of a post-restore script:
#!/usr/bin/env python3
import os
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = '/tmp/hycu/serviceAccount.json' - Click Restore.
Restoring storage
You can restore data that was stored on one or more disks at backup time to the same or a different location by restoring one or more persistent volume claims.
Important You cannot restore an application by restoring its storage. For instructions on how to restore a whole application, see Restoring a whole application.
Procedure
-
In the Applications panel, click the application whose storage you want to restore. The Detail view appears at the bottom of the screen.
Note The Detail view appears only if you click an application. Selecting the check box before the name of the application will not open the Detail view.
- In the Detail view, select the preferred restore point, and then click Restore. The Application Restore dialog box opens.
- Select Restore Storage, and then click Next.
-
From the Restore from drop-down menu, select which tier you want to use for the restore. Your restore point can contain one or more tiers among which you can select:
- Automatic: This option ensures the fastest and most cost-effective restore.
- Backup (Snapshot)
- Backup (Target)
- Copy
- Archive—(daily, weekly, monthly, yearly)
- From the Target cluster drop-down menu, select the cluster to which you want to restore storage. You can select only among the clusters that are in the same region as the application. By default, the original cluster of the application is selected.
- From the Target namespace drop-down menu, select the namespace to which you want to restore storage. The original namespace of the application is preselected.
-
Optional. In the Post-restore script field, enter the path to the script that R‑Cloud should run after the restore.
Important When entering the path to the script, make sure to enter it correctly, including lowercase and uppercase letters, as the path is case sensitive. You must specify the path in the following format:
gs://<PathtoBucket>/script.py parameter1 parameter2 ...
Example The following is an example of the first lines of a post-restore script:
#!/usr/bin/env python3
import os
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = '/tmp/hycu/serviceAccount.json' -
Select the persistent volume claims that you want to restore.
Tip Select the Disks check box to restore all persistent volume claims.
- Use the Keep original volumes switch if you want to keep the original persistent volumes. If you disable the switch, the original volumes will be overwritten by the restored ones.
- Click Restore.
Restoring resource objects
You can restore specific resource objects to their original or a different location.
Caution Restoring resource objects must be performed in the correct order, taking into account the dependencies among different resource objects.
Procedure
-
In the Applications panel, click the application whose resource objects you want to restore. The Detail view appears at the bottom of the screen.
Note The Detail view appears only if you click an application. Selecting the check box before the name of the application will not open the Detail view.
- In the Detail view, select the preferred restore point, and then click Restore. The Application Restore dialog box opens.
- Select Restore Resource Objects, and then click Next.
-
From the Restore from drop-down menu, select which tier you want to use for the restore. Your restore point can contain one or more tiers among which you can select:
- Automatic: This option ensures the fastest and most cost-effective restore.
- Backup (Snapshot)
- Backup (Target)
- Copy
- Archive—(daily, weekly, monthly, yearly)
- From the Target cluster drop-down menu, select the cluster to which you want to restore resource objects. The original cluster of the application is preselected.
-
Optional. In the Post-restore script field, enter the path to the script that R‑Cloud should run after the restore.
Important When entering the path to the script, make sure to enter it correctly, including lowercase and uppercase letters, as the path is case sensitive. You must specify the path in the following format:
gs://<PathtoBucket>/script.py parameter1 parameter2 ...
Example The following is an example of the first lines of a post-restore script:
#!/usr/bin/env python3
import os
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = '/tmp/hycu/serviceAccount.json' - Click Next.
-
From the list of available resource objects, select the ones that you want to restore.
- Click Restore.