mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 21:46:22 +01:00
53 lines
1.8 KiB
Plaintext
53 lines
1.8 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * virt/storage/virt-configuring-local-storage-with-hpp.adoc
|
|
// * virt/post_installation_configuration/virt-post-install-storage-config.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="virt-creating-hpp-basic-storage-pool_{context}"]
|
|
= Creating a hostpath provisioner with a basic storage pool
|
|
|
|
[role="_abstract"]
|
|
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.
|
|
|
|
[IMPORTANT]
|
|
====
|
|
Do not create storage pools 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.
|
|
====
|
|
|
|
.Prerequisites
|
|
|
|
* The directories specified in `spec.storagePools.path` must have read/write access.
|
|
* You have installed the {oc-first}.
|
|
|
|
.Procedure
|
|
|
|
. Create an `hpp_cr.yaml` file with a `storagePools` stanza as in the following example:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: hostpathprovisioner.kubevirt.io/v1beta1
|
|
kind: HostPathProvisioner
|
|
metadata:
|
|
name: hostpath-provisioner
|
|
spec:
|
|
imagePullPolicy: IfNotPresent
|
|
storagePools:
|
|
- name: any_name <1>
|
|
path: "/var/myvolumes" <2>
|
|
workload:
|
|
nodeSelector:
|
|
kubernetes.io/os: linux
|
|
----
|
|
<1> Specifies the name to identify the source to use. It must be the same as the `storagePools` name in the `StorageClass.yaml`. For example, `local`.
|
|
<2> Specifies the storage pool directories under this node path. Ensure that the path `/var/myvolumes` has been created on each worker node.
|
|
|
|
. Save the file and exit.
|
|
|
|
. Create the HPP by running the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc create -f hpp_cr.yaml
|
|
----
|