snc
snc copied to clipboard
Use hostpath provisioner to create on demand PV instead manually creating
Openshift support hostpath-provisioner https://docs.openshift.com/container-platform/4.7/virt/virtual_machines/virtual_disks/virt-configuring-local-storage-for-vms.html to use with storage class to create on demand pv/pvc which we should consume instead of creating those manually. It also means we are going to have one extra pod which is running for the provisioner.
the hostPath
provisioner apis are part of the OpenShift Virtualization operator, without installing openshift-cnv
these apis are not available. installation instructions are at: https://docs.openshift.com/container-platform/4.11/virt/install/installing-virt-cli.html but this operator is resource heavy and main purpose is to provide container native virtualization.
another option is to use the LocaVolume
operator its purpose is limited to storage, but this requires an extra block device in the node (for crc we need another disk attached to the vm or we could create a loop device to use)
prerequisites for using the localVolume operator: https://docs.openshift.com/container-platform/4.11/storage/persistent_storage/persistent-storage-local.html#local-volume-cr_persistent-storage-local
A more simpler solution perhaps, Since the main issue (https://github.com/code-ready/crc/issues/3336) is that PVs are not getting recycled and erroring out we could just create PVs with Reclaim Policy as delete
instead, and have the PVs get deleted, once an user runs out of the pre-created 10 or so PVs they can manually create more.
or we could use a CSI driver that handles local filesystem based storage, like https://github.com/alibaba/open-local