Configuration
This section will help you to configure the Local PV Hostpath.
#
Create StorageClassYou can skip this section if you would like to use the default OpenEBS Local PV Hostpath StorageClass created by OpenEBS.
The default Storage Class is called openebs-hostpath
and its BasePath
is configured as /var/openebs/local
.
To create your own StorageClass with custom
BasePath
, save the following StorageClass definition aslocal-hostpath-sc.yaml
#
(Optional) Custom Node LabelingIn Kubernetes, Local PV Hostpath identifies nodes using labels such as
kubernetes.io/hostname=<node-name>
. However, these default labels might not ensure each node is distinct across the entire cluster. To solve this, you can make custom labels. As an admin, you can define and set these labels when configuring a StorageClass. Here's a sample storage class:note
Using NodeAffinityLabels does not influence the scheduling of the application Pod. Use Kubernetes Allowed Topologies to configure scheduling options.
Edit
local-hostpath-sc.yaml
and update with your desired values formetadata.name
andcas.openebs.io/config.BasePath
.note
If the
BasePath
does not exist on the node, OpenEBS Dynamic Local PV Provisioner will attempt to create the directory, when the first Local Volume is scheduled on to that node. You must ensure that the value provided forBasePath
is a valid absolute path.Create OpenEBS Local PV Hostpath Storage Class.
Verify that the StorageClass is successfully created.
#
SupportIf you encounter issues or have a question, file a Github issue, or talk to us on the #openebs channel on the Kubernetes Slack server.