Skip to content

Commit f2b9410

Browse files
authored
Merge pull request #63955 from johnwilkins/TELCODOCS-1252
TELCODOCS-1252: D/S and R/N: OCPVE-297 Enable ext4 PVs on LVMS
2 parents f7d481e + d48c614 commit f2b9410

File tree

3 files changed

+64
-4
lines changed

3 files changed

+64
-4
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// This module is included in the following assemblies:
2+
//
3+
// storage/persistent_storage/persistent_storage_local/persistent-storage-using-lvms.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="adding-a-storage-class_{context}"]
7+
= Adding a storage class
8+
9+
You can add a storage class to an {product-title} cluster. A storage class describes a class of storage in the cluster and how the cluster dynamically provisions the persistent volumes (PVs) when the user specifies the storage class. A storage class describes the type of device classes, the quality-of-service level, the filesystem type, and other details.
10+
11+
.Procedure
12+
13+
. Create a YAML file:
14+
+
15+
[source,yaml]
16+
----
17+
apiVersion: storage.k8s.io/v1
18+
kind: StorageClass
19+
metadata:
20+
name: lvm-storageclass
21+
parameters:
22+
csi.storage.k8s.io/fstype: ext4
23+
topolvm.io/device-class: vg1
24+
provisioner: topolvm.io
25+
reclaimPolicy: Delete
26+
allowVolumeExpansion: true
27+
volumeBindingMode: WaitForFirstConsumer
28+
----
29+
+
30+
Save the file by using a name similar to the storage class name. For example, `lvm-storageclass.yaml`.
31+
32+
. Apply the YAML file by using the `oc` command:
33+
+
34+
[source,terminal]
35+
----
36+
$ oc apply -f <file_name> <1>
37+
----
38+
<1> Replace `<file_name>` with the name of the YAML file. For example, `lvm-storageclass.yaml`.
39+
+
40+
The cluster will create the storage class.
41+
42+
. Verify that the cluster created the storage class by using the following command:
43+
+
44+
[source,terminal]
45+
----
46+
$ oc get storageclass <name> <1>
47+
----
48+
<1> Replace `<name>` with the name of the storage class. For example, `lvm-storageclass`.
49+
+
50+
.Example output
51+
[source,terminal,options="nowrap",role="white-space-pre"]
52+
----
53+
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
54+
lvm-storageclass topolvm.io Delete WaitForFirstConsumer true 1s
55+
----

modules/lvms-creating-logical-volume-manager-cluster.adoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ spec:
4848
storage:
4949
deviceClasses: <1>
5050
- name: vg1
51-
default: true <2>
51+
fstype: ext4 <2>
52+
default: true <3>
5253
deviceSelector:
5354
paths:
5455
- /dev/disk/by-path/pci-0000:87:00.0-nvme-1
@@ -57,7 +58,7 @@ spec:
5758
name: thin-pool-1
5859
sizePercent: 90
5960
overprovisionRatio: 10
60-
nodeSelector: <3>
61+
nodeSelector: <4>
6162
nodeSelectorTerms:
6263
- matchExpressions:
6364
- key: app
@@ -68,9 +69,10 @@ spec:
6869
<1> To create multiple device storage classes in the cluster, create a YAML array under `deviceClasses` for each required storage class.
6970
Configure the local device paths of the disks as an array of values in the `deviceSelector` field.
7071
When configuring multiple device classes, you must specify the device path for each device.
71-
<2> Mandatory: The `LVMCluster` resource must contain a single default storage class. Set `default: false` for secondary device storage classes.
72+
<2> Set `fstype` to `ext4` or `xfs`. By default, it is set to `xfs` if the setting is not specified.
73+
<3> Mandatory: The `LVMCluster` resource must contain a single default storage class. Set `default: false` for secondary device storage classes.
7274
If you are upgrading the `LVMCluster` resource from a previous version, you must specify a single default device class.
73-
<3> Optional: To control what worker nodes the `LVMCluster` CR is applied to, specify a set of node selector labels.
75+
<4> Optional: To control what worker nodes the `LVMCluster` CR is applied to, specify a set of node selector labels.
7476
The specified labels must be present on the node in order for the `LVMCluster` to be scheduled on that node.
7577

7678
.. Create the `LVMCluster` CR:

storage/persistent_storage/persistent_storage_local/persistent-storage-using-lvms.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ include::modules/lvms-creating-logical-volume-manager-cluster.adoc[leveloffset=+
6868
6969
* xref:../../../storage/persistent_storage/persistent_storage_local/persistent-storage-using-lvms.adoc#lvms-reference-file_logical-volume-manager-storage[{lvms} reference YAML file]
7070
71+
//Adding a storage class
72+
include::modules/lvms-adding-a-storage-class.adoc[leveloffset=+1]
73+
7174
//Provisioning
7275
include::modules/lvms-provisioning-storage-using-logical-volume-manager-operator.adoc[leveloffset=+1]
7376

0 commit comments

Comments
 (0)