Backup PDS managed Kubernetes database to OCI S3 Object Storage

In this post I am going to share how to backup Portworx Data Services (PDS) managed Kubernetes databases to Oracle Cloud Infrastructure (OCI) S3 Object Storage buckets.

OCI Object Storage

Create OCI Bucket

Logon to Oracle Cloud Infrastructure (OCI) and from the Dashboard select Object Storage or via the hamburger menu navigate to Storage -> Object Storage -> Buckets.

Select your required Compartment, and click Create Bucket

Oracle Cloud Infrastructure (OCI) Object Storage Buckets
Object Storage and Archive Storage

Provide a Bucket Name, and confirm storage options, for this post I will use the Standard Default Storage Tier.

OCI also provides an archive storage tier for long-term storage which may be of interest as it is one-tenth of the cost of Standard object storage

Oracle Cloud Infrastructure (OCI) Object Storage Create Bucket
Object Storage & Archive Storage – Create Bucket

Note: Bucket names must be unique, if you have used the name even in another Compartment expect to see an error message.

By default the bucket is Private, however if required you can change the visibility by clicking on the 3 vertical ellipsis on the right hand side and updating it to Public.

Customer Secret Key

Before we can backup our PDS database to OCI we need to generate a Customer Secret for authentication.

From the OCI dashboard, Click on the Profile icon (top right), navigate to User Settings -> Customer Secret Keys and click Generate Secret Key providing a descriptive name.

Oracle Cloud Infrastructure (OCI)  Create Customer Secret Keys
Customer Secret Keys

Enter secret key Name

Oracle Cloud Infrastructure (OCI) Generate Secret Keys
Generate Secret Key

Once generated you will need to select Copy, this will be the Secret Key, which we will be using later.

Oracle Cloud Infrastructure (OCI)  Generated Secret Key
Generated Key

Now, click on the newly created Secret Name to obtain the Access Key, again save this for later.

Object Storage Namespace Name

From the OCI dashboard, Click on your Profile icon (top right), navigate to Tenancy

The Object Storage Namespace and default S3 compartments should be visible.

Oracle Cloud Infrastructure (OCI) Tenancy information
Tenancy details

Alternatively, you can use the OCI command line interface, for example.

% oci os ns get                                                                                                                                    
{
  "data": "<Object Storage Namespace>"
}

Portworx Data Services (PDS)

From the left hand panel click on Settings (gear icon) to access the settings options.

Portworx Data Services (PDS) menu
PDS Settings

Click on Add Backup Credentials and select S3 Compatible.

Provide a Name, the OCI Access Key, Secret Key and Endpoint captured earlier.

Portworx Data Services (PDS) Add S3 Compatible Cloud Account
Add S3 Compatible Cloud Account

The newly created Cloud Account should now be visible.

Portworx Data Services (PDS) Backup Credentials
Backup Credentials

Click on Targets and select Add Backup Targets.

Select Cloud Account, enter Name, Bucket Name and Region, for example.

Portworx Data Services (PDS) Add S3 Compatible Backup Target
Add S3 Compatible Backup Target

Click on the 3 vertical ellipsis, and select View Details, wait till the required Deployment Target has a green tick.

Backup Deployment

Now select Deployments from the left hand panel (disk icon) and click on type of deployment.

To Take Ad-hoc Backup, select Backup Target and click Backup

Portworx Data Services (PDS) Take Ad-hoc Backup
Take Ad-hoc Backup

After a few minutes the backup job will appear in the Backup Jobs panel.

Portworx Data Services (PDS) Backup Jobs
Backup Jobs

Oracle Object Storage

Return to OCI and navigate to the bucket, for example Storage -> Object Storage -> Bucket Details

Oracle Cloud Infrastructure (OCI) Object Storage Bucket Objects
Object Storage Bucket Details

It’s also possible to see details of the backup from the Kubernetes cluster by using pxctl cloudsnap status, for example.

% pxctl cloudsnap status --name 5b320cd7-5833-4881-882d-d4754ee276bb
Defaulted container "portworx" out of: portworx, csi-node-driver-registrar
NAME					SOURCEVOLUME		STATE		NODE		BYTES-PROCESSED	TIME-ELAPSED	ETA/COMPLETED	
5b320cd7-5833-4881-882d-d4754ee276bb	455952688535669561	Backup-Done	10.225.115.188	481 MiB		7.331008066s	Tue, 31 May 2022 15:51:35 UTC

Summary

In this post I shared how how can use the Portworx Data Services (PDS) to backup PDS managed Kubernetes databases to Oracle Cloud Infrastructure (OCI) S3 Object Storage.

Leave a Reply

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: