You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/blog/how-to-backup-and-restore-stateful-applications-on-kubernetes-using-kasten-k10-in-hpe-greenlake-for-private-cloud-enterprise.md
+31-31Lines changed: 31 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,21 +19,21 @@ tags:
19
19
20
20
[HPE GreenLake for Private Cloud Enterprise: Containers](https://www.hpe.com/us/en/greenlake/containers.html), one of the HPE GreenLake cloud services available on the HPE GreenLake for Private Cloud Enterprise, allows customers to create a Kubernetes (K8s) cluster, view details about existing clusters, and deploy containerized applications to the cluster. It provides an enterprise-grade container management service using open source K8s.
21
21
22
-
In the blog post [Getting started with volume snapshots on K8s cluster](https://developer.hpe.com/blog/getting-started-with-volume-snapshots-on-a-kubernetes-cluster-in-hpe-greenlake-for-private-cloud-enterprise/), I explained you how to create a volume snapshot of a persistent volume in a MySQL database instance running on a K8s cluster deployed on HPE GreenLake for Private Cloud Enterprise. In this blog post, I will show you how to backup and restore the stateful applications deployed in a K8s cluster in HPE GreenLake for Private Cloud Enterprise using Kasten K10. Kasten K10 uses the volume snapshot capability in HPE Container Storage Interface (CSI) driver for K8s to connect to different HPE storage systems and take volume snapshots of persistent volumes in K8s. It provides a user-friendly and intuitive interface and platform for easy and reliable backup and restore of the stateful applications running in the cluster.
22
+
In the blog post [Getting started with volume snapshots on K8s cluster](https://developer.hpe.com/blog/getting-started-with-volume-snapshots-on-a-kubernetes-cluster-in-hpe-greenlake-for-private-cloud-enterprise/), I explained how to create a volume snapshot of a persistent volume in a MySQL database instance running on a K8s cluster deployed on HPE GreenLake for Private Cloud Enterprise. In this blog post, I will show you how to backup and restore the stateful applications deployed in a K8s cluster in HPE GreenLake for Private Cloud Enterprise using Kasten K10. Kasten K10 uses the volume snapshot capability in the HPE Container Storage Interface (CSI) driver for K8s to connect to different HPE storage systems and take volume snapshots of persistent volumes in K8s. It provides a user-friendly and intuitive interface and platform for easy and reliable backup and restore of the stateful applications running in the cluster.
23
23
24
24
### Kasten K10
25
25
26
-
Kasten K10 is a data management platform purpose-built for K8s that was developed by Kasten. Following Veeam acquisition of Kasten early in 2020, Kasten K10 is often referred to as Kasten by Veeam.
26
+
Kasten K10 is a data management platform purpose-built for K8s that was developed by Kasten. Following Veeam's acquisition of Kasten early in 2020, Kasten K10 is often referred to as Kasten by Veeam.
27
27
28
28
Kasten K10 has been named [a Leader and Outperformer in GigaOm’s K8s Data Protection report for the third consecutive year](https://www.veeam.com/news/kasten.html). It offers an easy-to-use, scalable, and secure system for K8s backup/restore, disaster recovery and mobility of K8s applications.
29
29
30
-
Apart from direct integration with a number of storage providers, Kasten K10 supports invoking volume snapshots operations via the CSI driver for K8s. By using the volume snapshot capability in the CSI driver for K8s, Kasten K10 can access different types of storage systems that enables you to backup and restore persistent volumes of the stateful applications running on K8s.
30
+
Apart from direct integration with a number of storage providers, Kasten K10 supports invoking volume snapshots operations via the CSI driver for K8s. By using the volume snapshot capability in the CSI driver for K8s, Kasten K10 can access different types of storage systems that enable you to backup and restore persistent volumes of the stateful applications running on K8s.
31
31
32
32
### HPE CSI driver for K8s
33
33
34
34
The CSI defines a standard interface that allows container orchestration systems, such as K8s, to access storage systems. The CSI driver for K8s is a software component that implements the CSI specification and enables K8s to communicate with external storage systems. K8s supports many CSI drivers. HPE CSI Driver for K8s is one of the CSI drivers developed by HPE that uses the CSI to perform data management operations on different HPE storage systems, such as Nimble Storage, 3PAR and Primera.
35
35
36
-
The K8s cluster provisioned in HPE GreenLake for Private Cloud Enterprise comes with HPE CSI driver for K8s pre-installed and configured. The details of the HPE CSI driver for K8s deployed in the cluster under the namespace *'hpe-storage'* are shown below:
36
+
The K8s cluster provisioned in HPE GreenLake for Private Cloud Enterprise comes with the HPE CSI driver for K8s pre-installed and configured. The details of the HPE CSI driver for K8s deployed in the cluster under the namespace *'hpe-storage'* are shown below:
HPE CSI driver for K8s supports both dynamical persistent volumes and volume snapshots. The following are the *StorageClasses* and the *VolumeSnapshotClass* that are configured in the cluster:
70
+
HPE CSI driver for K8s supports both dynamic persistent volumes and volume snapshots. The following are the *StorageClasses* and the *VolumeSnapshotClass* that are configured in the cluster:
71
71
72
72
```shell
73
73
$ kubectl get storageclasses
@@ -83,11 +83,11 @@ NAME DRIVER DELETIONPOLICY AGE
83
83
gl-sbp-frank-gl1-sstor01 csi.hpe.com Delete 56d
84
84
```
85
85
86
-
[The joint partnership between HPE and Veeam](https://www.kasten.io/kubernetes/resources/blog/kubernetes-backup-with-hpe-csi-and-kasten-k10) supports HPE CSI driver for K8s and Kasten K10 as a data management solution for K8s backup and recovery. The following sections will show you how to install Kasten K10 on the cluster and how to use it with HPE CSI driver for K8s to backup and restore the persistent volumes of the stateful applications running in the cluster using volume snapshots.
86
+
[The joint partnership between HPE and Veeam](https://www.kasten.io/kubernetes/resources/blog/kubernetes-backup-with-hpe-csi-and-kasten-k10) supports HPE CSI driver for K8s and Kasten K10 as a data management solution for K8s backup and recovery. The following sections will show you how to install Kasten K10 on the cluster and how to use it with the HPE CSI driver for K8s to backup and restore the persistent volumes of the stateful applications running in the cluster using volume snapshots.
87
87
88
88
### Prerequisites
89
89
90
-
Before starting, make sure you meet the following requirements:
90
+
Before starting, make sure you have the following:
91
91
92
92
* A K8s cluster, being provisioned in HPE GreenLake for Private Cloud Enterprise
93
93
* The kubectl CLI tool, together with the kubeconfig file for accessing the K8s cluster
@@ -125,7 +125,7 @@ To establish a connection to it use the following `kubectl` command:
125
125
The Kasten dashboard will be available at: `http://127.0.0.1:8080/k10/#/`
126
126
```
127
127
128
-
With above commands, Kasten K10 is installed to the namespace *'kasten-io'* in the cluster. To validate the installation, typing the following command to watch the status of all Pods. Helm installs a list of Pods to the namespace. It takes a while before all those Pods start running.
128
+
With the above commands, Kasten K10 is installed to the namespace *'kasten-io'* in the cluster. To validate the installation, type the following command to watch the status of all Pods. Helm installs a list of Pods to the namespace. It takes a while before all those Pods start running.
129
129
130
130
```shell
131
131
$ kubectl get pods -n kasten-io -w
@@ -164,22 +164,22 @@ spec:
164
164
service/gateway edited
165
165
```
166
166
167
-
Typing the following command to get the *gateway* service endpoint:
167
+
Type the following command to get the *gateway* service endpoint:
168
168
169
169
```shell
170
170
$ kubectl get svc gateway -n kasten-io -o jsonpath={.metadata.annotations.hpecp-internal-gateway/8000}
The Kasten K10 service dashboard can then be accessed by pointing your browser to the URL '*http://gl-tor-upc-cp-gw-node1.customer.yyz.gl-hpe.local:10021/k10/#/'* :
174
+
The Kasten K10 service dashboard can now be accessed by pointing your browser to the URL '*http://gl-tor-upc-cp-gw-node1.customer.yyz.gl-hpe.local:10021/k10/#/'* :
175
175
176
176

177
177
178
-
Click *Accept Terms* after specifying your email and company name, you will be landed to Kasten K10 Dashboard:
178
+
Click *Accept Terms* after specifying your email and company name. This will land you on the Kasten K10 dashboard:
179
179
180
180

181
181
182
-
Kasten K10 automatically discovers all the applications and their data across namespaces in the cluster. The K10 Dashboard displays a list of applications that are mapped to namespaces. It also displays a summary of the cluster’s backup data footprint, showing *0.0 B* when accessing the dashboard for the first time.
182
+
Kasten K10 automatically discovers all the applications and their data across namespaces in the cluster. The K10 dashboard displays a list of applications that are mapped to namespaces. It also displays a summary of the cluster’s backup data footprint, showing *0.0 B* when accessing the dashboard for the first time.
183
183
184
184
To use Kasten K10 with HPE CSI driver for K8s, you need to ensure the configured *VolumeSnapshotClass* in the cluster contains the K10 annotation ***k10.kasten.io/is-snapshot-class: "true"***. Typing the following command to add this required K10 annotation to the *VolumeSnapshotClass*:
Whenever Kasten K10 detects volumes that were provisioned via the CSI driver deployed in the cluster, it will look for a *VolumeSnapshotClass* with this K10 annotation for the identified CSI driver and use it to create snapshots.
196
196
197
-
Typing the following command to verify the *VolumeSnapshotClass* has the required K10 annotation added:
197
+
Type the following command to verify the *VolumeSnapshotClass* has the required K10 annotation added:
In order to back up the MySQL database, go to the Kasten K10 Dashboard and click the *Applications*. Find the deployed MySQL database *'mysql'* from the application list and expand its menu. Then click *Snapshot* button.
449
+
In order to back up the MySQL database, go to the Kasten K10 dashboard and click the *Applications*. Find the deployed MySQL database *'mysql'* from the application list and expand its menu. Then click the*Snapshot* button.
450
450
451
451

452
452
453
453
Using all the default options from **Snapshot *mysql***, click *Snapshot Application* button:
454
454
455
455

456
456
457
-
The snapshot of the MySQL database will be started that takes a few seconds. Go back to the K10 Dashboard, you should see the completed *Backup* entry under **Actions** with protected object as *mysql*:
457
+
The snapshot of the MySQL database will be started. This takes a few seconds. When you go back to the K10 dashboard, you should see the completed *Backup* entry under **Actions** with protected object as *mysql*:
458
458
459
459

460
460
461
461
You can also check the **Data Usage** page to see the data used by database backups:
462
462
463
463

464
464
465
-
In the cluster, after snapshot of the MySQL database, you can check there is a *VolumeSnapshot**'k10-csi-snap-ltxzrwxgp6r5pwkp'* created from the source PVC *'mysql-pvc'* in the namespace *mysql*, together with a *VolumeSnapshotContent* object created at cluster level. The *READYTOUSE* of the *VolumeSnapshot* should be showing as *true*:
465
+
In the cluster, after snapshot of the MySQL database, you can check that there is a *VolumeSnapshot**'k10-csi-snap-ltxzrwxgp6r5pwkp'* created from the source PVC *'mysql-pvc'* in the namespace *mysql*, together with a *VolumeSnapshotContent* object created at cluster level. The *READYTOUSE* of the *VolumeSnapshot* should show as *true*:
466
466
467
467
```shell
468
468
$ kubectl get volumesnapshot -n mysql
@@ -478,7 +478,7 @@ This volume snapshot can be used for MySQL database restore.
478
478
479
479
### Restore MySQL database
480
480
481
-
Before showing the database restore, I will first delete some table from MySQL database to simulate a loss of data. Then, I will perform the database recovery using the Kasten K10.
481
+
Before showing the database restore, I will first delete a table from MySQL database to simulate a loss of data. Then, I will perform the database recovery using the Kasten K10.
482
482
483
483
**1. Delete table**
484
484
@@ -516,7 +516,7 @@ MySQL [employees]> delete from departments;
516
516
Query OK, 9 rows affected (1,523 sec)
517
517
```
518
518
519
-
If re-run the testing script *test_employees_sha.sql*, it will show the failures of *CRC* and *count* which indicate the loss of data in the MySQL database:
519
+
If you rerun the testing script *test_employees_sha.sql*, it will show the failures of *CRC* and *count*, which indicate the loss of data in the MySQL database:
520
520
521
521
```shell
522
522
$ mysql -h 127.0.0.1 -uroot -pCfeDemo@123 -P 42281 -t <test_employees_sha.sql
In order to restore the MySQL database, go to the Kasten K10 Dashboard, locate the MySQL database *'mysql'* from the application list, expand the menu of *mysql*, then click *Restore* button:
573
+
In order to restore the MySQL database, go to the Kasten K10 dashboard, locate the MySQL database *'mysql'* from the application list, expand the menu of *mysql*, and then click the *Restore* button:
574
574
575
575

576
576
577
577
Select a restore point from the list and click it. The **Restore Point** page will show up:
578
578
579
579

580
580
581
-
Use all the default options from **Restore Point** and click *Restore* button:
581
+
Use all the default options from **Restore Point** and click the *Restore* button:
582
582
583
583

584
584
585
-
The restore of the MySQL database will be started from the selected restore point. It will take a few seconds. Go back to the Kasten K10 Dashboard, you should see the completed *Restore* entry under **Actions** with target namespace as *mysql*:
585
+
The restore of the MySQL database will be started from the selected restore point. It will take a few seconds. Go back to the Kasten K10 dashboard. You should see the completed *Restore* entry under **Actions** with target namespace as *mysql*:
This indicates the MySQL database gets recovered from its backup and MySQL database data is back!
654
+
This indicates the MySQL database has been recovered from its backup and the MySQL database data is back!
655
655
656
656
### Summary
657
657
658
-
In this blog post, I explored the functionalities of Kasten K10 and HPE CSI driver for K8s. Using the volume snapshot capability in HPE CSI driver for K8s, I demonstrated how to use Kasten K10 to backup the persistent volume of a sample MySQL database deployed in the cluster in HPE GreenLake for Private Cloud Enterprise. I then illustrated how to restore database from the backup. Kasten K10, with its user-friendly and intuitive interface, simplifies the backup and recovery of stateful applications running in the cluster. It enhances the efficiency and reliability of data management in a K8s cluster.
658
+
In this blog post, I explored the functionalities of Kasten K10 and HPE CSI driver for K8s. Using the volume snapshot capability in HPE CSI driver for K8s, I demonstrated how to use Kasten K10 to backup the persistent volume of a sample MySQL database deployed in the cluster in HPE GreenLake for Private Cloud Enterprise. I then illustrated how to restore the database from the backup. Kasten K10, with its user-friendly and intuitive interface, simplifies the backup and recovery of stateful applications running in the cluster. It enhances the efficiency and reliability of data management in a K8s cluster.
659
659
660
-
You can keep coming back to the [HPE Developer blog](https://developer.hpe.com/blog/) to learn more about HPE GreenLake for Private Cloud Enterprise.
660
+
Please keep coming back to the [HPE Developer blog](https://developer.hpe.com/blog/) to learn more about HPE GreenLake for Private Cloud Enterprise.
0 commit comments