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
+27-25Lines changed: 27 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,12 +31,12 @@ Apart from direct integration with a number of storage providers, Kasten K10 sup
31
31
32
32
### HPE CSI driver for K8s
33
33
34
-
The CSI defines a standard interface for exposing storage systems to container orchestration systems, like K8s. The CSI driver for K8s is a software component that implements the CSI specification and provides a way for K8s to interact with external storage systems. There are several CSI drivers available for K8s. HPE CSI Driver for K8s is one of those CSI drivers developed by HPE that uses the CSI to perform data management operations on various HPE storage systems, such as Nimble Storage, 3PAR and Primera.
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
-
HPE CSI driver for K8s has been installed and configured as part of K8s cluster provisioning in HPE GreenLake for Private Cloud Enterprise. The following shows the details about deployed HPE CSI driver for K8s in the cluster to the namespace *'hpe-storage'*:
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:
HPE CSI driver for K8s supports both dynamical persistent volumes and volume snapshots. Here is the list of *StorageClasses* and the *VolumeSnapshotClass*created in the cluster:
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:
71
71
72
-
```markdown
73
-
$ kubectl get storageclasses
72
+
```shell
73
+
$ kubectl get storageclasses
74
74
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
HPE CSI driver for K8s and Kasten K10 has been a supported data management solution through the [joint partnership between HPE and Veeam](https://www.kasten.io/kubernetes/resources/blog/kubernetes-backup-with-hpe-csi-and-kasten-k10). In the following sections, I will first deploy Kasten k10 to the cluster. Then I will describe how to use Kasten K10 with the volume snapshot capability from HPE CSI driver for K8s to backup and restore persistent volumes of the stateful applications running in the cluster.
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.
87
87
88
88
### Prerequisites
89
89
@@ -128,7 +128,7 @@ The Kasten dashboard will be available at: `http://127.0.0.1:8080/k10/#/`
128
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 for the status of all Pods. Helm installs a list of Pods to the namespace. It takes a while before all those Pods start running.
After all the Pods are in running states, edit the service *gateway* to change its service type from *ClusterIP* to *NodePort*. This will generate a service port and expose the service via the configured gatway host name plus the generated port.
154
154
155
-
```markdown
156
-
$ kubectl edit svc gateway -n kasten-io
155
+
```shell
156
+
$ kubectl edit svc gateway -n kasten-io
157
157
…
158
158
spec:
159
159
selector:
@@ -166,7 +166,7 @@ service/gateway edited
166
166
167
167
Typing the following command to get the *gateway* service endpoint:
168
168
169
-
```markdown
169
+
```shell
170
170
$ kubectl get svc gateway -n kasten-io -o jsonpath={.metadata.annotations.hpecp-internal-gateway/8000}
@@ -211,7 +209,7 @@ In order to show backup and restore process, an MySQL database instance from
211
209
212
210
MySQL database requires a persistent volume to store data. Here is the *PersistentVolumeClaim* (PVC) YAML manifest file *mysql-pvc.yaml* in the repo's *'base'* folder:
213
211
214
-
```markdown
212
+
```shell
215
213
$ cat mysql-app/base/mysql-pvc.yaml
216
214
apiVersion: v1
217
215
kind: PersistentVolumeClaim
@@ -230,7 +228,7 @@ spec:
230
228
231
229
This PVC file, together with other YAML manifest files in the folder *base*, will be used to install the MySQL database instance using [Kustomize](https://kustomize.io/).
232
230
233
-
```markdown
231
+
```shell
234
232
$ tree mysql-app/base
235
233
mysql-app
236
234
/base
@@ -241,7 +239,7 @@ mysql-app
241
239
242
240
The file *kustomization.yaml* lists all YAML files in its resources section, together with the secret generator for MySQL password:
243
241
244
-
```markdown
242
+
```shell
245
243
$ cat mysql-app/base/kustomization.yaml
246
244
secretGenerator:
247
245
- name: mysql-pass
@@ -262,7 +260,11 @@ secret/mysql-pass-m62cbhd9kf created
262
260
service/mysql created
263
261
persistentvolumeclaim/mysql-pvc created
264
262
deployment.apps/mysql created
263
+
```
265
264
265
+
Typing the following command to check the MySQL database deployment state. The MySQL Pod should be in *Running* status:
266
+
267
+
```shell
266
268
$ kubectl get all -n mysql
267
269
NAME READY STATUS RESTARTS AGE
268
270
pod/mysql-6974b58d48-wb8g5 1/1 Running 0 14s
@@ -277,9 +279,9 @@ NAME DESIRED CURRENT READY AGE
277
279
replicaset.apps/mysql-6974b58d48 1 1 1 24s
278
280
```
279
281
280
-
You can check the *PersistentVolume* (PV) and the PVC provisioned as part of the MySQL database deployment:
282
+
You can check the *PersistentVolume* (PV) and the PVC get provisioned as part of the MySQL database deployment:
281
283
282
-
```markdown
284
+
```shell
283
285
$ kubectl get persistentvolumes
284
286
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
In order to access MySQL database service using the mysql CLI, set first the port-forward of *service/mysql*:
296
298
297
-
```markdown
298
-
$ k port-forward service/mysql -n mysql 42281:3306
299
+
```shell
300
+
$ kubectl port-forward service/mysql -n mysql 42281:3306
299
301
Forwarding from 127.0.0.1:42281 -> 3306
300
302
Forwarding from [::1]:42281 -> 3306
301
303
Handling connection for 42281
@@ -328,7 +330,7 @@ MySQL [(none)]> show databases;
328
330
329
331
The MySQL application repo has the *'test'* folder that contains a list of scripts for populating data records and testing the contents:
330
332
331
-
```markdown
333
+
```shell
332
334
$ tree mysql-app/test
333
335
mysql-app/test
334
336
├── employees.sql
@@ -463,11 +465,11 @@ You can also check the **Data Usage** page to see the data used by database b
463
465
In the cluster, after snapshot of the MySQL database, you can check there is a *VolumeSnapshot**k10-csi-snap-ltxzrwxgp6r5pwkp* created from the 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*:
464
466
465
467
```shell
466
-
$ k get volumesnapshot -n mysql
468
+
$ kubectl get volumesnapshot -n mysql
467
469
NAME READYTOUSE SOURCEPVC SOURCESNAPSHOTCONTENT RESTORESIZE SNAPSHOTCLASS SNAPSHOTCONTENT CREATIONTIME AGE
0 commit comments