Skip to content

Commit 0442fa7

Browse files
committed
Update Blog “getting-started-with-volume-snapshots-on-a-kubernetes-cluster-in-hpe-greenlake-for-private-cloud-enterprise”
1 parent 6c7c9e3 commit 0442fa7

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

content/blog/getting-started-with-volume-snapshots-on-a-kubernetes-cluster-in-hpe-greenlake-for-private-cloud-enterprise.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ NAME DRIVER DELETIONPOLICY AGE
118118
gl-sbp-frank-gl1-sstor01 csi.hpe.com Delete 56d
119119
```
120120

121-
Now that you understand the basics, in the following sections, I will describe how to create volume snapshots of persistent volumes in K8s using HPE CSI driver for K8s.
121+
Now that you understand the basics, in the following sections, I will describe how to create volume snapshots of persistent volumes in K8s using the HPE CSI driver for K8s.
122122

123123
### Prerequisites
124124

125125

126126

127-
Before starting, make sure you meet the following requirements:
127+
Before starting, make sure you have the following:
128128

129129

130130

@@ -204,11 +204,11 @@ resources:
204204

205205

206206

207-
Typing below command to install the MySQL database to the namespace *mysql*:
207+
Type below command to install the MySQL database to the namespace *mysql*:
208208

209209

210210

211-
```markdown
211+
```shell
212212
$ kubectl apply -k mysql-app/base
213213
namespace/mysql created
214214
secret/mysql-pass-m62cbhd9kf created
@@ -217,7 +217,11 @@ persistentvolumeclaim/mysql-pvc created
217217
deployment.apps/mysql created
218218

219219

220+
```
220221

222+
Type the following command to check the MySQL database deployment state. The MySQL Pod should be in *Running* status:
223+
224+
```shell
221225
$ kubectl get all -n mysql
222226
NAME READY STATUS RESTARTS AGE
223227
pod/mysql-6974b58d48-wb8g5 1/1 Running 0 14s
@@ -234,7 +238,7 @@ replicaset.apps/mysql-6974b58d48 1 1 1 24s
234238

235239

236240

237-
You can check the PVC and the PV created as part of MySQL database deployment:
241+
You can check that the PVC and the PV created as part of MySQL database deployment:
238242

239243

240244

@@ -256,7 +260,7 @@ mysql-pvc Bound pvc-3e55e9b3-097f-4ddf-bdcb-60825a7905ec 1Gi RWO
256260

257261

258262

259-
In order to access MySQL database service using the mysql CLI, set first the port-forward of _service/mysql_:
263+
In order to access MySQL database service using the mysql CLI, first set the port-forward of _service/mysql_:
260264

261265

262266
```markdown
@@ -298,7 +302,7 @@ MySQL [(none)]> show databases;
298302

299303

300304

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

303307

304308

@@ -321,7 +325,7 @@ mysql-app/test
321325

322326

323327

324-
Typing the following command to populate a sample *employees* data to the MySQL database:
328+
Type the following command to populate a sample *employees* data to the MySQL database:
325329

326330

327331

@@ -350,7 +354,7 @@ NULL
350354

351355

352356

353-
The added sample data records *employees* can be checked and verified by running below commands:
357+
The added sample data records called *employees* can be checked and verified by running commands shown below:
354358

355359

356360

@@ -434,7 +438,7 @@ $ mysql -h 127.0.0.1 -uroot -pCfeDemo@123 -P 41797 -t < test_employees_sha.sql
434438

435439

436440

437-
Here is the *VolumeSnapshot* YAML manifest file that creates a volume snapshot from the PVC *'mysql-pvc'*:
441+
Here is the *VolumeSnapshot* YAML manifest file that creates a volume snapshot from the source PVC *'mysql-pvc'*:
438442

439443

440444

@@ -453,7 +457,7 @@ persistentVolumeClaimName: mysql-pvc
453457

454458

455459

456-
Typing the following command to create the volume snapshot:
460+
Type the following command to create the volume snapshot:
457461

458462

459463

@@ -464,7 +468,7 @@ volumesnapshot.snapshot.storage.k8s.io/mysql-snapshot created
464468

465469

466470

467-
You can check the volume snapshot *mysql-snapshot* is created in the namespace *mysql*. A *VolumeSnapshotContent* object is also created, at cluster level, with its *READYTOUSE* showing as *true*:
471+
You can check that there is a *VolumeSnapshot* *'mysql-snapshot'* is created in the namespace *mysql*, together with a *VolumeSnapshotContent* object created at cluster level. The *READYTOUSE* of the *VolumeSnapshot* should show as *true*:
468472

469473

470474

@@ -486,7 +490,7 @@ snapcontent-41de6346-1ba3-4ce7-9483-2ca074e476a2 true 1073741824 De
486490

487491

488492

489-
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 from the created volume snapshot.
493+
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 from the created volume snapshot.
490494

491495

492496

@@ -530,7 +534,7 @@ Query OK, 9 rows affected (1,523 sec)
530534

531535

532536

533-
If re-run the testing script *test_employees_sha.sql*, it will show the failures of *CRC* and *count*:
537+
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:
534538

535539

536540

@@ -605,7 +609,7 @@ deployment.apps/mysql scaled
605609

606610

607611

608-
Typing below command to check the MySQL database deployment has 0 replica:
612+
Type below command to check the MySQL database deployment has 0 replica:
609613

610614

611615

@@ -686,7 +690,7 @@ pvc-92940c36-eb1d-4de5-9c1e-57261ccbecad 1Gi RWO Delete
686690

687691

688692

689-
Typing the following command to edit the MySQL deployment config and change the PVC name from *mysql-pvc* to *mysql-pvc-restore*:
693+
Type the following command to edit the MySQL deployment config and change the PVC name from *mysql-pvc* to *mysql-pvc-restore*:
690694

691695

692696

@@ -739,7 +743,7 @@ replicaset.apps/mysql-6974b58d48 0 0 0 36m
739743

740744

741745

742-
You can connect to the MySQL database service and re-run the testing script. You should see the testing script now reports everything is *OK*:
746+
You can connect to the MySQL database service and rerun the testing script. You should see the testing script now reports everything is *OK*:
743747

744748

745749

@@ -824,7 +828,7 @@ $ mysql -h 127.0.0.1 -uroot -pCfeDemo@123 -P 43959 -t <test_employees_sha.sql
824828
+---------+--------+
825829
```
826830

827-
This indicates the database restore using the volume snapshot succeeds and MySQL database data is back !
831+
This indicates the database restore using the volume snapshot succeeds and MySQL database data is back!
828832

829833

830834

0 commit comments

Comments
 (0)