Skip to content

Commit fefbd82

Browse files
committed
Create Blog “getting-started-with-volume-snapshots-on-a-kubernetes-cluster-in-hpe-greenlake-for-private-cloud-enterprise”
1 parent 54807f8 commit fefbd82

File tree

1 file changed

+109
-0
lines changed

1 file changed

+109
-0
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
title: Getting started with volume snapshots on a Kubernetes cluster in HPE
3+
GreenLake for Private Cloud Enterprise
4+
date: 2024-01-23T14:24:28.483Z
5+
author: Guoping Jia
6+
authorimage: /img/guoping.png
7+
disable: false
8+
tags:
9+
- HPE GreenLake for Private Cloud Enterprise
10+
- Kubernetes
11+
- Persistent volumes
12+
- Volume snapshots
13+
- HPE CSI driver for Kubernetes
14+
- Stateful applications
15+
- Backup and restore
16+
---
17+
### Overview
18+
19+
20+
21+
[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.
22+
23+
In this blog post, I discuss first the persistent volumes and volume snapshots in K8s. Then I describe the Container Storage Interface (CSI) and HPE CSI driver for K8s in HPE GreenLake for Private Cloud Enterprise. With a MySQL database instance deployed as a sample stateful application using persistent volume in the cluster, I show the detailed steps to create a volume snapshot of the database as a backup using HPE CSI driver. Finally I describe how to restore MySQL database using the created volume snapshot.
24+
25+
### Persistent volumes and volume snapshots
26+
27+
28+
29+
In K8s, a persistent volume (PV) is a piece of storage in the cluster that has been provisioned, either statically by an administer or dynamically using *StorageClasses*. It provides a way for data to persist beyond the lifecycle of individual Pods. PV provides the necessary data persistence for stateful applications, ensuring that they function correctly even in the event of Pod or node failures. So it's a key component in managing storage in K8s. Backing up PVs is then becoming a critical aspect of managing stateful applications in K8s.
30+
31+
32+
33+
A volume snapshot is a copy of the data stored in a PV in K8s at a specific point in time. It provides the ability to create snapshot of a PV from stateful applications. Volume snapshot can be used to back up data of a PV, restore a PV from a previous state, or create a new PV from a snapshot. Volume snapshot provides K8s users with a standardized way to copy the contents of a PV at a particular point in time without creating an entirely new volume. This functionality enables, for example, database administrators to backup databases before perfoming edit or delete modifications.
34+
35+
36+
37+
Support of volume snapshots in K8s is only available for CSI driver deployed in the cluster.
38+
39+
### HPE CSI driver for K8s
40+
41+
42+
43+
CSI defines a standard interface for container orchestration systems, like K8s, to expose arbitrary block and file storage systems to their containerized workloads. Support for CSI in K8s was introduced as *alpha* in its v1.9 release, and promoted to *beta* in its v1.10 release. Since v1.13 release, the implementation of the CSI has been in *GA* in K8s. With the adoption of CSI, the K8s volume layer becomes truly extensible. Using CSI, 3rd party storage providers, such as HPE, can write and deploy plugins exposing new storage systems in K8s without ever having to touch the core K8s code. This gives K8s users more options for storage and makes the system more secure and reliable.
44+
45+
46+
47+
48+
A CSI driver for K8s is a plugin that allows K8s to access different types of storage systems, such as Azure Disks, AWS EBS, and HPE Storage, etc. HPE CSI driver for K8s is one of those CSI driver plugins that follows the K8s CSI specification and enables K8s to use various HPE storage systems, such as Nimble Storage, 3PAR and Primera.
49+
50+
51+
52+
As part of K8s cluster provisioning in HPE GreenLake for Private Cloud Enterprise, HPE CSI driver for K8s has been installed on the cluster. The installation consists of two components, a _controller_ component and a _per-node_ component. The controller component is deployed as a *Deployment* on any node in the K8s cluster. It implements the CSI Controller service and a list of sidecar containers, such as _external-provisioner_, _external-attacher_, _external-snapshotter_, and _external-resizer_, etc. These controller sidecar containers typically interact with K8s objects, make calls to the driver’s CSI Controller service, manage K8s events and make the appropriate calls to the CSI driver. The per-node component is deployed on every node in the cluster through a _DaemonSet_. It implements the CSI Node service and the _node-driver-registrar_ sidecar container that registers the CSI driver to kubelet running on every cluster node and being responsible for making the CSI Node service calls. These calls mount and unmount the storage volume from the HPE storage system, making it available to the Pod to consume.
53+
54+
55+
As part of HPE CSI driver configuration, a list of _StorageClasses_ is created that refers to the CSI driver name. The _PersistentVolumeClaim_ (PVCs) can then be created that uses the _StorageClass_ to dynamically provision persisten volume backed by the HPE storage systems.
56+
57+
Apart from features such as dynamic provisioning, raw block volumes, inline ephemeral volumes, and volume encryption, HPE CSI driver implements and supports volume snapshot on K8s cluster. The common snapshot controller _snapshot-controller_ and a _VolumeSnapshotClass_, together with a list of snapshot CustomResourceDefinitions (CRDs), gets deployed and added to the cluster.
58+
59+
The following shows the details about deployed HPE CSI driver for K8s in the cluster
60+
to the namespace *hpe-storage*:
61+
62+
```markdown
63+
$ kubectl get all -n hpe-storage
64+
NAME READY STATUS RESTARTS AGE
65+
pod/hpe-csi-controller-54cf448d85-g4w4c 9/9 Running 0 56d
66+
pod/hpe-csi-node-5xtdb 2/2 Running 0 56d
67+
pod/nimble-csp-74d57f9487-qxwln 1/1 Running 0 56d
68+
pod/primera3par-csp-59f5dfc499-hfghx 1/1 Running 0 56d
69+
pod/snapshot-controller-5fd799f6b5-f6k7n 1/1 Running 6 (22d ago) 56d
70+
pod/snapshot-controller-5fd799f6b5-z62dc 1/1 Running 2 (27d ago) 56d
71+
72+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
73+
service/alletra6000-csp-svc ClusterIP 10.101.79.85 <none> 8080/TCP 56d
74+
service/alletra9000-csp-svc ClusterIP 10.97.147.230 <none> 8080/TCP 56d
75+
service/nimble-csp-svc ClusterIP 10.110.238.43 <none> 8080/TCP 56d
76+
service/primera3par-csp-svc ClusterIP 10.101.42.76 <none> 8080/TCP 56d
77+
78+
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
79+
daemonset.apps/hpe-csi-node 1 1 1 1 1 <none> 56d
80+
81+
NAME READY UP-TO-DATE AVAILABLE AGE
82+
deployment.apps/hpe-csi-controller 1/1 1 1 56d
83+
deployment.apps/nimble-csp 1/1 1 1 56d
84+
deployment.apps/primera3par-csp 1/1 1 1 56d
85+
deployment.apps/snapshot-controller 2/2 2 2 56d
86+
87+
NAME DESIRED CURRENT READY AGE
88+
replicaset.apps/hpe-csi-controller-54cf448d85 1 1 1 56d
89+
replicaset.apps/nimble-csp-74d57f9487 1 1 1 56d
90+
replicaset.apps/primera3par-csp-59f5dfc499 1 1 1 56d
91+
replicaset.apps/snapshot-controller-5fd799f6b5 2 2 2 56d
92+
```
93+
94+
Here is the list of _StorageClasses_ and the _VolumeSnapshotClass_ created in the cluster:
95+
96+
```markdown
97+
$ kubectl get storageclasses
98+
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
99+
gl-sbc-hpe csi.hpe.com Delete Immediate true 56d
100+
gl-sbp-frank-gl1-sstor01 (default) csi.hpe.com Delete Immediate true 56d
101+
hpe-hdd-storage kubernetes.io/no-provisioner Delete WaitForFirstConsumer false 56d
102+
hpe-nvme-storage kubernetes.io/no-provisioner Delete WaitForFirstConsumer false 56d
103+
hpe-ssd-storage kubernetes.io/no-provisioner Delete WaitForFirstConsumer false 56d
104+
105+
$ kubectl get volumesnapshotclasses
106+
NAME DRIVER DELETIONPOLICY AGE
107+
gl-sbp-frank-gl1-sstor01 csi.hpe.com Delete 56d
108+
```
109+

0 commit comments

Comments
 (0)