crc-org / crc

CRC is a tool to help you run containers. It manages a local OpenShift 4.x cluster, Microshift or a Podman VM optimized for testing and development purposes
https://crc.dev
Apache License 2.0
1.26k stars 242 forks source link

create `LVMCluster` resource on `crc start` #4097

Closed anjannath closed 5 months ago

anjannath commented 7 months ago

after https://github.com/crc-org/snc/issues/867 openshift bundles will have the LVMS operator installed in the cluster, to make use of it we need to create the LVMCluster crd resource provided by the operator to have the necessary storage class, CSI drivers setup to handle dynamic provisioning of the PVCs

to create the LVMCluster resource we also need to provide the disk to be used for creating the lvm volumes, so we need to also create a second disk image for the vm.

apiVersion: lvm.topolvm.io/v1alpha1
kind: LVMCluster
metadata:
  name: my-lvmcluster
spec:
  storage:
    deviceClasses:
    - name: vg1
      fstype: ext4 
      default: true
      deviceSelector: 
        paths:
        - /dev/disk/by-path/pci-0000:87:00.0-nvme-1
        - /dev/disk/by-path/pci-0000:88:00.0-nvme-1
        forceWipeDevicesAndDestroyAllData: true
      thinPoolConfig:
        name: thin-pool-1
        sizePercent: 90 
        overprovisionRatio: 10

Todo

cfergeau commented 7 months ago

add a config option to enable users to choose if they want to use LVMS operator

why a config option?

anjannath commented 7 months ago

add a config option to enable users to choose if they want to use LVMS operator

why a config option?

initially, i thought of having a config option to enable/disable the topolvm, and also keep the hostpath-provisioner that we have currently, but it doesn't have any usefulness for users, it was just a thought to be able to test quickly the new topolvm without removing the hostpath-provisioner

anjannath commented 5 months ago

this is not needed anymore, installation of the operator is now handled in snc, by https://github.com/crc-org/snc/pull/877