From 1005ff4f06df8b2b31d416c1d491dffef698b4e3 Mon Sep 17 00:00:00 2001 From: Catherine Luse Date: Fri, 8 Jan 2021 18:07:48 -0700 Subject: [PATCH] Update steps to restore Rancher --- .../backups/v2.5/restoring-rancher/_index.md | 35 +++++++++++++++++-- .../rollbacks/_index.md | 2 +- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/content/rancher/v2.x/en/backups/v2.5/restoring-rancher/_index.md b/content/rancher/v2.x/en/backups/v2.5/restoring-rancher/_index.md index 0bc2cfd3676..3d07d4e56cc 100644 --- a/content/rancher/v2.x/en/backups/v2.5/restoring-rancher/_index.md +++ b/content/rancher/v2.x/en/backups/v2.5/restoring-rancher/_index.md @@ -13,7 +13,9 @@ A restore is performed by creating a Restore custom resource. > * Follow the instructions from this page for restoring rancher on the same cluster where it was backed up from. In order to migrate rancher to a new cluster, follow the steps to [migrate rancher.](../migrating-rancher) > * While restoring rancher on the same setup, the operator will scale down the rancher deployment when restore starts, and it will scale back up the deployment once restore completes. So Rancher will be unavailable during the restore. -### Create the Restore Custom Resource +First, create the Restore custom resource. Then restart Rancher using the previous Rancher version. + +### 1. Create the Restore Custom Resource 1. In the **Cluster Explorer,** go to the dropdown menu in the upper left corner and click **Rancher Backups.** 1. Click **Restore.** @@ -42,7 +44,7 @@ A restore is performed by creating a Restore custom resource. 1. Click **Create.** -**Result:** The rancher-operator scales down the rancher deployment during restore, and scales it back up once the restore completes. The resources are restored in this order: +The rancher-operator scales down the rancher deployment during restore, and scales it back up once the restore completes. The resources are restored in this order: 1. Custom Resource Definitions (CRDs) 2. Cluster-scoped resources @@ -53,4 +55,33 @@ To check how the restore is progressing, you can check the logs of the operator. ```yaml kubectl get pods -n cattle-resources-system kubectl logs -n cattle-resources-system -f +``` + +2. Restart Rancher + +Rancher has to be started with the lower/previous version after a rollback using the Rancher backup operator. It should be started with the same Helm chart values as the previous install. + +Get the values, which were passed with `--set`, from the current Rancher Helm chart that is installed: + +``` +helm get values rancher -n cattle-system + +hostname: rancher.my.org +``` + +> **Note:** There will be more values that are listed with this command. This is just an example of one of the values. + +Alternatively, it's possible to export the current values to a file and reference that file during upgrade. For example, to only change the Rancher version: + +``` +helm get values rancher -n cattle-system -o yaml > values.yaml +``` + +Then upgrade the Helm chart to the previous Rancher version, using the previous values. In this example, the values are taken from the file: + +``` +helm upgrade rancher rancher-/rancher \ + --namespace cattle-system \ + -f values.yaml \ + --version=X.Y.Z ``` \ No newline at end of file diff --git a/content/rancher/v2.x/en/installation/install-rancher-on-k8s/rollbacks/_index.md b/content/rancher/v2.x/en/installation/install-rancher-on-k8s/rollbacks/_index.md index 8464b15f5e4..387be38d940 100644 --- a/content/rancher/v2.x/en/installation/install-rancher-on-k8s/rollbacks/_index.md +++ b/content/rancher/v2.x/en/installation/install-rancher-on-k8s/rollbacks/_index.md @@ -10,7 +10,7 @@ aliases: - /rancher/v2.x/en/installation/install-rancher-on-k8s/upgrades-rollbacks/rollbacks --- -To roll back to Rancher v2.5+, use the `rancher-backup` application and restore Rancher from backup according to [this section.]({{}}/rancher/v2.x/en/backups/restoring-rancher/) +To roll back to Rancher v2.5.0+, use the `rancher-backup` application and restore Rancher from backup according to [this section.]({{}}/rancher/v2.x/en/backups/v2.5/restoring-rancher/) Rancher has to be started with the lower/previous version after a rollback using the Rancher backup operator. To roll back to Rancher prior to v2.5, follow the procedure detailed here: [Restoring Backups — Kubernetes installs]({{}}/rancher/v2.x/en/backups/restorations/ha-restoration) Restoring a snapshot of the Rancher Server cluster will revert Rancher to the version and state at the time of the snapshot.