Astra Control Service (ACS) is a NetApp-managed service that provides a rich set of application-aware data management functionalities for running your business-critical Kubernetes applications in multiple cloud environments. It enhances developer agility, driving productivity and operational efficiencies.
ACS provides an easy-to-use GUI with which you can add clusters, define applications running on them, and perform application aware data management activities. ACS functions can also be accessed using an API that allows for automation of workflows. There is also a self-managed version called Astra Control Center (ACC) that can be deployed in your own Kubernetes clusters on-premises or cloud environments.
Powering Astra Control (ACS or ACC) is NetApp Astra Trident, NetApp’s container storage interface (CSI) driver. Astra Trident supports several types of Kubernetes clusters such as Red Hat OpenShift, EKS, AKS, SUSE Rancher, Anthos etc., with various flavors of NetApp ONTAP storage such as FAS/AFF, ONTAP Select, Cloud Volumes ONTAP, Google Cloud Volumes Service, Azure NetApp Files and Amazon FSx for NetApp ONTAP.
In this blog, I will demonstrate the use of Astra Control Service to perform snapshot and restore operations for an application on a ROSA cluster that uses Amazon FSx for NetApp ONTAP for persistent storage. Creating snapshots on demand or configuring snapshot and backup policies, restoring the application using a specified snapshot can be accomplished with a click of a button in Astra Control.
For all the pre-requisite installations, please read the blog, Implement a fully managed shared file storage for Red Hat OpenShift Service on AWS (ROSA) with Amazon FSx for NetApp ONTAP. The authors of that blog take you through the process of installing a ROSA Cluster, Amazon FSx for NetApp ONTAP, NetApp Trident CSI driver on the ROSA cluster and deploying a stateful application that uses dynamic NAS persistent volumes backed by FSx for ONTAP.
Once you have completed the pre-requisite steps, you should have a mysql application running on your ROSA cluster that contains a database with a table and one record added to it. I have shown you the contents of the mysql database. Let us pick it up from there.
Follow the step-by-step instructions here in this blog to create a snapshot of the mysql application and to restore the application using ACS.
Here are the steps:
- Create a kubeconfig file for the cluster.
- Add the cluster into ACS.
- Define the application in ACS.
- Create a snapshot using ACS.
- Delete the database in the mysql application.
- Restore from a snapshot using ACS. (in-place restore)
- Verify your app has been restored from the snapshot.
Let us walk through each of the steps.
1. Create a kubeconfig file for the cluster
Follow the procedures here to create a kubeconfig file for the ROSA cluster. This kubeconfig file will be used to add the cluster into ACS.
2. Add the cluster into ACS
Log in to ACS. Select cluster and click on Add. Select other and upload or paste the kubeconfig file that you previously created for the cluster.
Click Next and select ontap-nas as the default storage class for ACS. Click Next, review the details and Add the cluster.
3. Define the application in ACS
Next, let us define the mysql application in ACS. From the landing page, select Applications, Define, and fill in the appropriate details. Click Next a couple of times, Review the details and click Define. The application gets added to ACS.
4. Create a snapshot using ACS
There are many ways to create a snapshot in ACS. You can select the application and create a snapshot from the page that shows the details of the application. You can click on Create snapshot to create an on-demand snapshot or select Configure a protection policy.
Let us create an on-demand snapshot by simply clicking on Create snapshot, providing a name, reviewing the details, and clicking on Snapshot. The snapshot state changes to Healthy after the operation is completed.
5. Delete the database in the mysql application
Log back into mysql, delete the database you created previously.
6. Restore from a snapshot using ACS
Since you have now lost your database, you want to restore the application from a snapshot to get the database back. From the ACS UI, select the application and select Restore. You need to pick a snapshot or a backup from which to restore. (Typically, you would have multiple created based on a policy that you have configured). You can choose to restore to the same namespace or to a new namespace. Let us choose same namespace. Keep all the default choices in the next couple of screens and then click on Restore. The application status moves from Restoring to Available after it has been restored from the snapshot.
7. Verify your app has been restored from the snapshot
Login to the mysql client and you should now see the table and the record in the table that you previously had. That’s it. Just by clicking a button, your application has been restored to a previous state. That is how easy we make it for our customers with Astra Control.
Summary
In this article, you have seen how quick and easy it can be to restore a stateful application running on ROSA clusters with Amazon FSx for NetApp ONTAP as the backing storage for persistent volumes. Astra Control simplifies data management capabilities that enhance your productivity. With new features being added in every release, it should be the tool of choice in your tool chest.
Additional Resources
Refer to the documentation for additional information about Astra Control family of products, Amazon FSx for NetApp ONTAP, and Red Hat OpenShift Service in AWS.