Add Rancher clusters
Portworx Backup now extends its support on Rancher and enables you to add a Rancher cloud account and map Rancher projects. You can create a backup of namespaces and resources on a Rancher source cluster and restore them on a Rancher destination cluster.
Besides, you can also map a source cluster project with that of the destination cluster for custom restores. This project mapping facilitates to pick the required projects and map their namespaces and resources to specific projects during restore.
Prerequisites
-
Installation prerequisites should be met
-
Install Stork
-
Rancher web UI version - 2.0 and above
-
Active and valid Rancher web UI credentials
-
User permissions to create Rancher API keys
-
Rancher cloud account in Portworx Backup
Add Rancher Cluster
To add a Rancher Cluster in Portworx Backup:
-
In the home page, from the left navigation pane, click Clusters.
-
In the upper-right corner, click Connect cluster:
-
In the Add Cluster page, under Select Kubernetes Platform, click Rancher icon.
-
Under Cluster Details:
-
Cluster name: enter a name for your cluster
-
Kubeconfig: retrieve the Kubeconfig from your cluster and paste it here or click Browse to upload it from a file
-
-
Choose the required type of Kubernetes service (where your Rancher is deployed) from Kubernetes service radio group.
-
In the Rancher Account Information section, choose the required Rancher account you created recently.
-
Click Add Cluster.
Home page displays the newly created Rancher cluster and now you can utilize this cluster to create and restore backup of your namespaces and resources.
You can also edit the Rancher cluster to update kubeconfig (when the cluster details change) and/or Rancher cloud account (if cloud account differs) details if the need arises:
notePortworx Backup currently supports configuration and addition of RKE2 version clusters.
Project Mapping in Rancher Cluster
Project mapping is associating a project of a Rancher source cluster with that of a Rancher destination cluster while restoring backups from one cluster to another.
Project mapping involves the below tasks:
-
Creation of projects in source cluster with required configuration parameters and then associating namespaces and/or resources with these projects using Rancher UI.
-
Creation of destination cluster and projects with the required configuration.
-
Creating backup of the required namespaces and resources in Portworx Backup UI and then mapping these two projects during custom restore.
Project mapping assists you for effective management of namespaces and resources of a Rancher cluster. In addition, it enables you to seamlessly restore your namespaces and resources residing on a Rancher source cluster to a destination cluster.
To map the projects residing on source and destination Rancher clusters in Portworx Backup during restore, refer Step 4 in Restore from a backup.
Prerequisites
To map the projects during custom restore, ensure that you have:
-
Valid cloud credentials
-
View/create permissions to create projects in Rancher UI
-
Ensure a project exists in the destination cluster with the required configuration parameters
-
Backup contains the namespace associated with a project
-
Project list of the destination cluster is accessible for Portworx Backup
To restore a namespace or resource from a source cluster to destination cluster, you should have all the necessary details of the source cluster project to perform project mapping.
To back up and restore a namespace or resource residing on Rancher cluster, refer the following topics:
Rancher web console
You need to create users, restrict permissions when needed, create API keys in the Rancher web console. All these serve as prerequisites to add cloud account and to manage Rancher clusters in Portworx Backup.
Create users and restrict permissions
-
Click on the left navigation pane and select Users and Authentication.
-
Create a new user, provide the required Username, Display name, Description and Password.
-
Under Global Permissions, select User-Base and then click Create.
-
From the left navigation pane, navigate to the destination cluster under EXPLORE CLUSTER.
-
From the left navigation pane, go to Cluster > Cluster Members.
-
Click Add, select the user created in step 3 for Select Member.
-
Select Custom under Cluster Permissions.
-
Choose only View All Projects and click Create.
This allows a specific user to only view all the projects.
Create API keys
-
Log in to Rancher web UI as a local user with valid credentials of the user created in Create users and restrict permissions
-
Refer API Keys to create API keys.
notePureStorage recommends you to choose
No scope
for theScope
option of API key. Also chooseNever
forAutomatically expire
option to avoid updating the secret key in Portworx Backup web console frequently.