Skip to content

Commit 4545487

Browse files
committed
BZ2102745: Fix storage yaml indents
1 parent 80e8c61 commit 4545487

14 files changed

+258
-241
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/virtual_machines/virtual_disks/virt-configuring-local-storage-for-vms.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="virt-about-creating-storage-classes_{context}"]
7+
= About creating storage classes
8+
9+
When you create a storage class, you set parameters that affect the dynamic provisioning of persistent volumes (PVs) that belong to that storage class. You cannot update a `StorageClass` object's parameters after you create it.
10+
11+
In order to use the hostpath provisioner (HPP) you must create an associated storage class for the CSI driver with the `storagePools` stanza.
12+
13+
[NOTE]
14+
====
15+
Virtual machines use data volumes that are based on local PVs. Local PVs are bound to specific nodes. While the disk image is prepared for consumption by the virtual machine, it is possible that the virtual machine cannot be scheduled to the node where the local storage PV was previously pinned.
16+
17+
To solve this problem, use the Kubernetes pod scheduler to bind the persistent volume claim (PVC) to a PV on the correct node. By using the `StorageClass` value with `volumeBindingMode` parameter set to `WaitForFirstConsumer`, the binding and provisioning of the PV is delayed until a pod is created using the PVC.
18+
====

modules/virt-about-hostpath-provisioner.adoc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@
44

55
:_content-type: CONCEPT
66
[id="virt-about-hostpath-provisioner_{context}"]
7-
= About the hostpath provisioner (HPP)
7+
= About the hostpath provisioner
88

9-
When you install the {VirtProductName} Operator, the Hostpath Provisioner Operator is automatically installed. The HPP is a local storage provisioner designed for {VirtProductName} that is created by the Hostpath Provisioner Operator. To use the HPP, you must create a HPP custom resource.
9+
When you install the {VirtProductName} Operator, the Hostpath Provisioner (HPP) Operator is automatically installed. The HPP is a local storage provisioner designed for {VirtProductName} that is created by the Hostpath Provisioner Operator. To use the HPP, you must create an HPP custom resource (CR).
1010

1111
[IMPORTANT]
1212
====
13-
In {VirtProductName} 4.10, the HPP Operator configures the Kubernetes CSI driver. The Operator also recognizes the existing (legacy) format of the custom resource.
13+
In {VirtProductName} 4.10, the HPP Operator configures the Kubernetes CSI driver. The Operator also recognizes the existing (legacy) format of the HPP CR.
1414
15-
The legacy HPP and the CSI host path driver are supported in parallel for a number of releases. However, at some point, the legacy HPP will no longer be supported. If you use the HPP, plan to create a storage class for the CSI driver as part of your migration strategy.
15+
The legacy HPP and the Container Storage Interface (CSI) driver are supported in parallel for a number of releases. However, at some point, the legacy HPP will no longer be supported. If you use the HPP, plan to create a storage class for the CSI driver as part of your migration strategy.
1616
====
1717

1818
If you upgrade to {VirtProductName} version 4.10 on an existing cluster, the HPP Operator is upgraded and the system performs the following actions:
1919

2020
* The CSI driver is installed.
21-
* The CSI driver is configured with the contents of your legacy custom resource.
21+
* The CSI driver is configured with the contents of your legacy HPP CR.
2222
2323
If you install {VirtProductName} version 4.10 on a new cluster, you must perform the following actions:
2424

25-
* Create the HPP custom resource including a `storagePools` stanza in the HPP custom resource.
25+
* Create an HPP CR with a basic storage pool.
2626
* Create a storage class for the CSI driver.
27+
28+
Optional: You can create a storage pool with a PVC template for multiple HPP volumes.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/virtual_machines/virtual_disks/virt-configuring-local-storage-for-vms.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="virt-about-storage-pools-pvc-templates_{context}"]
7+
= About storage pools created with PVC templates
8+
9+
If you have a single, large persistent volume (PV), you can create a storage pool by defining a PVC template in the hostpath provisioner (HPP) custom resource (CR).
10+
11+
A storage pool created with a PVC template can contain multiple HPP volumes. Splitting a PV into smaller volumes provides greater flexibility for data allocation.
12+
13+
The PVC template is based on the `spec` stanza of the `PersistentVolumeClaim` object:
14+
15+
.Example `PersistentVolumeClaim` object
16+
[source,yaml]
17+
----
18+
apiVersion: v1
19+
kind: PersistentVolumeClaim
20+
metadata:
21+
name: iso-pvc
22+
spec:
23+
volumeMode: Block <1>
24+
storageClassName: my-storage-class
25+
accessModes:
26+
- ReadWriteOnce
27+
resources:
28+
requests:
29+
storage: 5Gi
30+
----
31+
<1> This value is only required for block volume mode PVs.
32+
33+
You define a storage pool using a `pvcTemplate` specification in the HPP CR. The Operator creates a PVC from the `pvcTemplate` specification for each node containing the HPP CSI driver. The PVC created from the PVC template consumes the single large PV, allowing the HPP to create smaller dynamic volumes.
34+
35+
You can combine basic storage pools with storage pools created from PVC templates.

modules/virt-creating-custom-resources-hpp.adoc

Lines changed: 0 additions & 40 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/virtual_machines/virtual_disks/virt-configuring-local-storage-for-vms.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="virt-creating-hpp-basic-storage-pool_{context}"]
7+
= Creating a hostpath provisioner with a basic storage pool
8+
9+
You configure a hostpath provisioner (HPP) with a basic storage pool by creating an HPP custom resource (CR) with a `storagePools` stanza. The storage pool specifies the name and path used by the CSI driver.
10+
11+
.Prerequisites
12+
13+
* The directories specified in `spec.storagePools.path` must have read/write access.
14+
* The storage pools must not be in the same partition as the operating system. Otherwise, the operating system partition might become filled to capacity, which will impact performance or cause the node to become unstable or unusable.
15+
16+
.Procedure
17+
18+
. Create an `hpp_cr.yaml` file with a `storagePools` stanza as in the following example:
19+
+
20+
[source,yaml]
21+
----
22+
apiVersion: hostpathprovisioner.kubevirt.io/v1beta1
23+
kind: HostPathProvisioner
24+
metadata:
25+
name: hostpath-provisioner
26+
spec:
27+
imagePullPolicy: IfNotPresent
28+
storagePools: <1>
29+
- name: any_name
30+
path: "/var/myvolumes" <2>
31+
workload:
32+
nodeSelector:
33+
kubernetes.io/os: linux
34+
----
35+
<1> The `storagePools` stanza is an array to which you can add multiple entries.
36+
<2> Specify the storage pool directories under this node path.
37+
38+
. Save the file and exit.
39+
40+
. Create the HPP by running the following command:
41+
+
42+
[source,terminal]
43+
----
44+
$ oc create -f hpp_cr.yaml
45+
----

modules/virt-creating-single-pvc-template-storage-pool.adoc

Lines changed: 0 additions & 78 deletions
This file was deleted.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/virtual_machines/virtual_disks/virt-configuring-local-storage-for-vms.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="virt-creating-storage-class-csi-driver_{context}"]
7+
= Creating a storage class for the CSI driver with the storagePools stanza
8+
9+
You create a storage class custom resource (CR) for the hostpath provisioner (HPP) CSI driver.
10+
11+
.Prerequisites
12+
13+
* You must have {VirtProductName} 4.10 or later.
14+
15+
.Procedure
16+
17+
. Create a `storageclass_csi.yaml` file to define the storage class:
18+
+
19+
[source,yaml]
20+
----
21+
apiVersion: storage.k8s.io/v1
22+
kind: StorageClass
23+
metadata:
24+
name: hostpath-csi <1>
25+
provisioner: kubevirt.io.hostpath-provisioner
26+
reclaimPolicy: Delete <2>
27+
volumeBindingMode: WaitForFirstConsumer <3>
28+
parameters:
29+
storagePool: my-storage-pool <4>
30+
----
31+
<1> Assign any meaningful name to the storage class. In this example, `csi` is used to specify that the class is using the CSI provisioner instead of the legacy provisioner. Choosing descriptive names for storage classes, based on legacy or CSI driver provisioning, eases implementation of your migration strategy.
32+
<2> The two possible `reclaimPolicy` values are `Delete` and `Retain`. If you do not specify a value, the default value is `Delete`.
33+
<3> The `volumeBindingMode` parameter determines when dynamic provisioning and volume binding occur. Specify `WaitForFirstConsumer` to delay the binding and provisioning of a persistent volume (PV) until after a pod that uses the persistent volume claim (PVC) is created. This ensures that the PV meets the pod's scheduling requirements.
34+
<4> Specify the name of the storage pool defined in the HPP CR.
35+
36+
. Save the file and exit.
37+
38+
. Create the `StorageClass` object by running the following command:
39+
+
40+
[source,terminal]
41+
----
42+
$ oc create -f storageclass_csi.yaml
43+
----
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * virt/virtual_machines/virtual_disks/virt-configuring-local-storage-for-vms.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="virt-creating-storage-class-legacy-hpp_{context}"]
7+
= Creating a storage class for the legacy hostpath provisioner
8+
9+
You create a storage class for the legacy hostpath provisioner (HPP) by creating a `StorageClass` object without the `storagePool` parameter.
10+
11+
.Procedure
12+
13+
. Create a `storageclass.yaml` file to define the storage class:
14+
+
15+
[source,yaml]
16+
----
17+
apiVersion: storage.k8s.io/v1
18+
kind: StorageClass
19+
metadata:
20+
name: hostpath-provisioner
21+
provisioner: kubevirt.io/hostpath-provisioner
22+
reclaimPolicy: Delete <1>
23+
volumeBindingMode: WaitForFirstConsumer <2>
24+
----
25+
<1> The two possible `reclaimPolicy` values are `Delete` and `Retain`. If you do not specify a value, the storage class defaults to `Delete`.
26+
<2> The `volumeBindingMode` value determines when dynamic provisioning and volume binding occur. Specify the `WaitForFirstConsumer` value to delay the binding and provisioning of a persistent volume until after a pod that uses the persistent volume claim (PVC) is created. This ensures that the PV meets the pod's scheduling requirements.
27+
28+
. Save the file and exit.
29+
30+
. Create the `StorageClass` object by running the following command:
31+
+
32+
[source,terminal]
33+
----
34+
$ oc create -f storageclass.yaml
35+
----
36+
37+
[role="_additional-resources"]
38+
.Additional resources
39+
40+
* link:https://kubernetes.io/docs/concepts/storage/storage-classes/[Storage classes]

0 commit comments

Comments
 (0)