Skip to content

Commit 8a2cd75

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 308cc47 commit 8a2cd75

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
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: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ Apart from direct integration with a number of storage providers, Kasten K10 sup
3131

3232
### HPE CSI driver for K8s
3333

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

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

38-
```markdown
39-
$ kubectl get all -n hpe-storage
38+
```shell
39+
$ kubectl get all -n hpe-storage
4040
NAME READY STATUS RESTARTS AGE
4141
pod/hpe-csi-controller-54cf448d85-g4w4c 9/9 Running 0 56d
4242
pod/hpe-csi-node-5xtdb 2/2 Running 0 56d
@@ -67,23 +67,23 @@ 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. 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:
7171

72-
```markdown
73-
$ kubectl get storageclasses
72+
```shell
73+
$ kubectl get storageclasses
7474
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
7575
gl-sbc-hpe csi.hpe.com Delete Immediate true 56d
7676
gl-sbp-frank-gl1-sstor01 (default) csi.hpe.com Delete Immediate true 56d
7777
hpe-hdd-storage kubernetes.io/no-provisioner Delete WaitForFirstConsumer false 56d
7878
hpe-nvme-storage kubernetes.io/no-provisioner Delete WaitForFirstConsumer false 56d
7979
hpe-ssd-storage kubernetes.io/no-provisioner Delete WaitForFirstConsumer false 56d
8080

81-
$ kubectl get volumesnapshotclasses
81+
$ kubectl get volumesnapshotclasses
8282
NAME DRIVER DELETIONPOLICY AGE
8383
gl-sbp-frank-gl1-sstor01 csi.hpe.com Delete 56d
8484
```
8585

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

8888
### Prerequisites
8989

@@ -128,7 +128,7 @@ The Kasten dashboard will be available at: `http://127.0.0.1:8080/k10/#/`
128128
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.
129129

130130
```shell
131-
$ kubectl get pods -n kasten-io -w
131+
$ kubectl get pods -n kasten-io -w
132132
NAME READY STATUS RESTARTS AGE
133133
aggregatedapis-svc-6fc8fcf7bd-cdw8p 1/1 Running 0 15m
134134
auth-svc-6fcb76d7df-pt748 1/1 Running 0 15m
@@ -152,8 +152,8 @@ state-svc-b4b996d9b-jnbrl 3/3 Running 0 15m
152152

153153
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.
154154

155-
```markdown
156-
$ kubectl edit svc gateway -n kasten-io
155+
```shell
156+
$ kubectl edit svc gateway -n kasten-io
157157
158158
spec:
159159
selector:
@@ -166,7 +166,7 @@ service/gateway edited
166166

167167
Typing the following command to get the *gateway* service endpoint:
168168

169-
```markdown
169+
```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
```
@@ -188,8 +188,6 @@ $ kubectl get volumesnapshotclasses
188188
NAME DRIVER DELETIONPOLICY AGE
189189
gl-sbp-frank-gl1-sstor01 csi.hpe.com Delete 69d
190190

191-
192-
193191
$ kubectl annotate volumesnapshotclasses gl-sbp-frank-gl1-sstor01 k10.kasten.io/is-snapshot-class=true
194192
volumesnapshotclasses.snapshot.storage.k8s.io/gl-sbp-frank-gl1-sstor01 annotated
195193
```
@@ -211,7 +209,7 @@ In order to show backup and restore process, an MySQL database instance from
211209

212210
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:
213211

214-
```markdown
212+
```shell
215213
$ cat mysql-app/base/mysql-pvc.yaml
216214
apiVersion: v1
217215
kind: PersistentVolumeClaim
@@ -230,7 +228,7 @@ spec:
230228

231229
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/).
232230

233-
```markdown
231+
```shell
234232
$ tree mysql-app/base
235233
mysql-app
236234
/base
@@ -241,7 +239,7 @@ mysql-app
241239

242240
The file *kustomization.yaml* lists all YAML files in its resources section, together with the secret generator for MySQL password:
243241

244-
```markdown
242+
```shell
245243
$ cat mysql-app/base/kustomization.yaml
246244
secretGenerator:
247245
- name: mysql-pass
@@ -262,7 +260,11 @@ secret/mysql-pass-m62cbhd9kf created
262260
service/mysql created
263261
persistentvolumeclaim/mysql-pvc created
264262
deployment.apps/mysql created
263+
```
265264

265+
Typing the following command to check the MySQL database deployment state. The MySQL Pod should be in *Running* status:
266+
267+
```shell
266268
$ kubectl get all -n mysql
267269
NAME READY STATUS RESTARTS AGE
268270
pod/mysql-6974b58d48-wb8g5 1/1 Running 0 14s
@@ -277,9 +279,9 @@ NAME DESIRED CURRENT READY AGE
277279
replicaset.apps/mysql-6974b58d48 1 1 1 24s
278280
```
279281

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

282-
```markdown
284+
```shell
283285
$ kubectl get persistentvolumes
284286
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
285287

@@ -294,8 +296,8 @@ mysql-pvc Bound pvc-3e55e9b3-097f-4ddf-bdcb-60825a7905ec 1Gi RWO
294296

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

297-
```markdown
298-
$ k port-forward service/mysql -n mysql 42281:3306
299+
```shell
300+
$ kubectl port-forward service/mysql -n mysql 42281:3306
299301
Forwarding from 127.0.0.1:42281 -> 3306
300302
Forwarding from [::1]:42281 -> 3306
301303
Handling connection for 42281
@@ -328,7 +330,7 @@ MySQL [(none)]> show databases;
328330

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

331-
```markdown
333+
```shell
332334
$ tree mysql-app/test
333335
mysql-app/test
334336
├── employees.sql
@@ -463,11 +465,11 @@ You can also check the **Data Usage** page to see the data used by database b
463465
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*:
464466

465467
```shell
466-
$ k get volumesnapshot -n mysql
468+
$ kubectl get volumesnapshot -n mysql
467469
NAME READYTOUSE SOURCEPVC SOURCESNAPSHOTCONTENT RESTORESIZE SNAPSHOTCLASS SNAPSHOTCONTENT CREATIONTIME AGE
468470
k10-csi-snap-ltxzrwxgp6r5pwkp true mysql-pvc 1Gi gl-sbp-frank-gl1-sstor01 snapcontent-f3890356-d47f-4b36-a7e4-eb4c5792ec59 6d12h 6d12h
469471

470-
$ k get volumesnapshotcontents
472+
$ kubectl get volumesnapshotcontents
471473
NAME READYTOUSE RESTORESIZE DELETIONPOLICY DRIVER VOLUMESNAPSHOTCLASS VOLUMESNAPSHOT VOLUMESNAPSHOTNAMESPACE AGE
472474
snapcontent-f3890356-d47f-4b36-a7e4-eb4c5792ec59 true 1073741824 Delete csi.hpe.com gl-sbp-frank-gl1-sstor01 k10-csi-snap-ltxzrwxgp6r5pwkp mysql 6d12h
473475
```

0 commit comments

Comments
 (0)