Skip to content

Commit 6454284

Browse files
committed
Update Blog “how-to-backup-and-restore-stateful-applications-on-kubernetes-using-kasten-k10-in-hpe-greenlake-for-private-cloud-enterprise”
1 parent b6fd3d0 commit 6454284

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

content/blog/how-to-backup-and-restore-stateful-applications-on-kubernetes-using-kasten-k10-in-hpe-greenlake-for-private-cloud-enterprise.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ tags:
1919

2020
[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.
2121

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.
2323

2424
### Kasten K10
2525

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.
2727

2828
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.
2929

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.
3131

3232
### HPE CSI driver for K8s
3333

3434
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.
3535

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:
3737

3838
```shell
3939
$ kubectl get all -n hpe-storage
@@ -67,7 +67,7 @@ replicaset.apps/primera3par-csp-59f5dfc499 1 1 1 56d
6767
replicaset.apps/snapshot-controller-5fd799f6b5 2 2 2 56d
6868
```
6969

70-
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:
7171

7272
```shell
7373
$ kubectl get storageclasses
@@ -83,11 +83,11 @@ NAME DRIVER DELETIONPOLICY AGE
8383
gl-sbp-frank-gl1-sstor01 csi.hpe.com Delete 56d
8484
```
8585

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.
8787

8888
### Prerequisites
8989

90-
Before starting, make sure you meet the following requirements:
90+
Before starting, make sure you have the following:
9191

9292
* A K8s cluster, being provisioned in HPE GreenLake for Private Cloud Enterprise
9393
* 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:
125125
The Kasten dashboard will be available at: `http://127.0.0.1:8080/k10/#/`
126126
```
127127

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.
129129

130130
```shell
131131
$ kubectl get pods -n kasten-io -w
@@ -164,22 +164,22 @@ spec:
164164
service/gateway edited
165165
```
166166

167-
Typing the following command to get the *gateway* service endpoint:
167+
Type the following command to get the *gateway* service endpoint:
168168

169169
```shell
170170
$ kubectl get svc gateway -n kasten-io -o jsonpath={.metadata.annotations.hpecp-internal-gateway/8000}
171171
gl-tor-upc-cp-gw-node1.customer.yyz.gl-hpe.local:10021
172172
```
173173

174-
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/#/'* :
175175

176176
![](/img/k10-login.png)
177177

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:
179179

180180
![](/img/k10-dashboard.png)
181181

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.
183183

184184
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*:
185185

@@ -194,7 +194,7 @@ volumesnapshotclasses.snapshot.storage.k8s.io/gl-sbp-frank-gl1-sstor01 annotated
194194

195195
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.
196196

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:
198198

199199
```shell
200200
$ kubectl get volumesnapshotclass gl-sbp-frank-gl1-sstor01 -o yaml -o jsonpath='{.metadata.annotations}' | jq . | grep kasten
@@ -251,7 +251,7 @@ resources:
251251
- mysql-pvc.yaml
252252
```
253253

254-
Typing below command to install the MySQL database to the namespace *'mysql'*:
254+
Type below command to install the MySQL database to the namespace *'mysql'*:
255255

256256
```shell
257257
$ kubectl apply -k mysql-app/base
@@ -262,7 +262,7 @@ persistentvolumeclaim/mysql-pvc created
262262
deployment.apps/mysql created
263263
```
264264

265-
Typing the following command to check the MySQL database deployment state. The MySQL Pod should be in *Running* status:
265+
Type the following command to check the MySQL database deployment state. The MySQL Pod should be in *Running* status:
266266

267267
```shell
268268
$ kubectl get all -n mysql
@@ -279,7 +279,7 @@ NAME DESIRED CURRENT READY AGE
279279
replicaset.apps/mysql-6974b58d48 1 1 1 24s
280280
```
281281

282-
You can check the *PersistentVolume* (PV) and the PVC get provisioned as part of the MySQL database deployment:
282+
You can check that the *PersistentVolume* (PV) and the PVC get provisioned as part of the MySQL database deployment:
283283

284284
```shell
285285
$ kubectl get persistentvolumes
@@ -294,7 +294,7 @@ mysql-pvc Bound pvc-3e55e9b3-097f-4ddf-bdcb-60825a7905ec 1Gi RWO
294294

295295
**2. Access MySQL database**
296296

297-
In order to access MySQL database service using the mysql CLI, set first the port-forward of *service/mysql*:
297+
In order to access MySQL database service using the mysql CLI, first set the port-forward of *service/mysql*:
298298

299299
```shell
300300
$ kubectl port-forward service/mysql -n mysql 42281:3306
@@ -328,7 +328,7 @@ MySQL [(none)]> show databases;
328328

329329
**3. Populate MySQL database**
330330

331-
The MySQL application repo has the *'test'* folder that contains a list of scripts for populating data records and testing the contents:
331+
The MySQL application repo has a *'test'* folder that contains a list of scripts for populating data records and testing the contents:
332332

333333
```shell
334334
$ tree mysql-app/test
@@ -347,7 +347,7 @@ mysql-app/test
347347
└── test_employees_sha.sql
348348
```
349349

350-
Typing the following command to populate a sample *employees* data to the MySQL database:
350+
Type the following command to populate a sample *employees* data to the MySQL database:
351351

352352
```shell
353353
$ cd mysql-app/test
@@ -372,7 +372,7 @@ data_load_time_diff
372372
NULL
373373
```
374374

375-
The added sample data records *employees* can be checked and verified by running below commands:
375+
The added sample data records called *employees* can be checked and verified by running the commands shown below:
376376

377377
```shell
378378
$ mysql -h 127.0.0.1 -uroot -pCfeDemo@123 -P 42281
@@ -446,23 +446,23 @@ $ mysql -h 127.0.0.1 -uroot -pCfeDemo@123 -P 42281 -t < test_employees_sha.sql
446446

447447
### Back up MySQL database
448448

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 *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.
450450

451451
![](/img/k10-backup-button.png)
452452

453453
Using all the default options from **Snapshot *mysql***, click *Snapshot Application* button:
454454

455455
![](/img/k10-backup.png)
456456

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*:
458458

459459
![](/img/k10-dashboard-backup.png)
460460

461461
You can also check the **Data Usage** page to see the data used by database backups:
462462

463463
![](/img/k10-data-backup.png)
464464

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*:
466466

467467
```shell
468468
$ kubectl get volumesnapshot -n mysql
@@ -478,7 +478,7 @@ This volume snapshot can be used for MySQL database restore.
478478

479479
### Restore MySQL database
480480

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.
482482

483483
**1. Delete table**
484484

@@ -516,7 +516,7 @@ MySQL [employees]> delete from departments;
516516
Query OK, 9 rows affected (1,523 sec)
517517
```
518518

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:
520520

521521
```shell
522522
$ mysql -h 127.0.0.1 -uroot -pCfeDemo@123 -P 42281 -t <test_employees_sha.sql
@@ -570,19 +570,19 @@ $ mysql -h 127.0.0.1 -uroot -pCfeDemo@123 -P 42281 -t <test_employees_sha.sql
570570

571571
**2. Perform MySQL database restore**
572572

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*, 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:
574574

575575
![](/img/k10-restore-button.png)
576576

577577
Select a restore point from the list and click it. The **Restore Point** page will show up:
578578

579579
![](/img/k10-restore-point.png)
580580

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:
582582

583583
![](/img/k10-restore.png)
584584

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*:
586586

587587
![](/img/k10-dashboard-restore.png)
588588

@@ -651,10 +651,10 @@ $ mysql -h 127.0.0.1 -uroot -pCfeDemo@123 -P 42281 -t < test_employees_sha.sql
651651
+---------+--------+
652652
```
653653

654-
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!
655655

656656
### Summary
657657

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.
659659

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

Comments
 (0)