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.
- Kubernetes version - 1.24 and above
- Rancher web UI version - 2.0 and above
- Stork version - 23.7.2 and newer
- Active and valid Rancher web UI credentials
- User permissions to create Rancher API keys
Add Rancher Account
You need to add a Rancher cloud account in Portworx Backup before adding a Rancher cluster if you need to map projects for Rancher clusters.
To add a Rancher cloud account:
From the home page, navigate to Settings >> Cloud Settings and click Add.
In the Add Cloud Account page, select Rancher from the Please choose a cloud provider drop-down.
Provide a cloud account name of your choice.NOTE: Note down the API endpoint in the below format to fetch the Endpoint details:
Portworx Backup successfully adds a Rancher cloud account and displays it in the Cloud Accounts section of Cloud Settings page.
You can also edit the Rancher cloud account to update the endpoint (when there is change in setup) and secret key (if the secret key expires) details when needed:
Add Rancher Cluster
To add a Rancher Cluster in Portworx Backup:
In the home page, click Add Cluster.
In the Add Cluster page, under Select Kubernetes Platform, click Rancher icon.
Under Cluster Details: a. Provide a name for your cluster. b. Copy the kubeconfig details from the CLI and paste it in the Kubeconfig field. c. 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:
NOTE: Portworx 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.
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.NOTE: PureStorage recommends setting no expiry option to avoid updating the secret key in Portworx Backup UI frequently.