{"id":13581584,"url":"https://github.com/metal-stack/csi-driver-lvm","last_synced_at":"2026-01-08T11:11:20.624Z","repository":{"id":37893429,"uuid":"237418744","full_name":"metal-stack/csi-driver-lvm","owner":"metal-stack","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-12T08:58:37.000Z","size":1474,"stargazers_count":148,"open_issues_count":11,"forks_count":26,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-27T07:08:20.581Z","etag":null,"topics":["csi-lvm"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metal-stack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-31T11:42:51.000Z","updated_at":"2025-03-26T13:30:14.000Z","dependencies_parsed_at":"2023-02-12T21:16:16.005Z","dependency_job_id":"e4a78da8-9899-495b-a4f7-8b6b252b9534","html_url":"https://github.com/metal-stack/csi-driver-lvm","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metal-stack%2Fcsi-driver-lvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metal-stack%2Fcsi-driver-lvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metal-stack%2Fcsi-driver-lvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metal-stack%2Fcsi-driver-lvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metal-stack","download_url":"https://codeload.github.com/metal-stack/csi-driver-lvm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246961952,"owners_count":20861181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csi-lvm"],"created_at":"2024-08-01T15:02:06.532Z","updated_at":"2026-01-08T11:11:20.618Z","avatar_url":"https://github.com/metal-stack.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# csi-driver-lvm #\n\ncsi-driver-lvm utilizes local storage of Kubernetes nodes to provide persistent storage for pods.\n\nIt automatically creates hostPath based persistent volumes on the nodes.\n\nUnderneath it creates a LVM logical volume on the local disks. A comma-separated list of grok pattern, which disks to use must be specified.\n\nThis CSI driver is derived from [csi-driver-host-path](https://github.com/kubernetes-csi/csi-driver-host-path) and [csi-lvm](https://github.com/metal-stack/csi-lvm)\n\n\u003e [!WARNING]\n\u003e Note that there is always an inevitable risk of data loss when working with local volumes. For this reason, be sure to back up your data or implement proper data replication methods when using this CSI driver.\n\n## Currently it can create, delete, mount, unmount and resize block and filesystem volumes via lvm ##\n\nFor the special case of block volumes, the filesystem-expansion has to be performed by the app using the block device\n\n## Automatic PVC Deletion on Pod Eviction\n\nThe persistent volumes created by this CSI driver are strictly node-affine to the node on which the pod was scheduled. This is intentional and prevents pods from starting without the LV data, which resides only on the specific node in the Kubernetes cluster.\n\nConsequently, if a pod is evicted (potentially due to cluster autoscaling or updates to the worker node), the pod may become stuck. In certain scenarios, it's acceptable for the pod to start on another node, despite the potential for data loss. The csi-driver-lvm-controller can capture these events and automatically delete the PVC without requiring manual intervention by an operator.\n\nTo use this functionality, the following is needed:\n\n- This only works on `StatefulSet`s with volumeClaimTemplates and volume references to the `csi-driver-lvm` storage class\n- In addition to that, the `Pod` or `PersistentVolumeClaim` managed by the `StatefulSet` needs the annotation: `metal-stack.io/csi-driver-lvm.is-eviction-allowed: true`\n\n## Installation ##\n\n**For convenience, helm charts for installation are synced to a separate repository called [helm-charts](https://github.com/metal-stack/helm-charts). The source for this chart is located in the `charts` folder.**\n\nYou have to set the `devicePattern` for your hardware to specify which disks should be used to create the volume group.\n\n```bash\nhelm install csi-driver-lvm ./charts/csi-driver-lvm --set lvm.devicePattern='/dev/nvme[0-9]n[0-9]'\n# or alternatively after the a release:\n# helm install --repo https://helm.metal-stack.io csi-driver-lvm csi-driver-lvm --set lvm.devicePattern='/dev/nvme[0-9]n[0-9]'\n```\n\nNow you can use one of following storageClasses:\n\n* `csi-driver-lvm-linear`\n* `csi-driver-lvm-mirror`\n* `csi-driver-lvm-striped`\n\nTo get the previous old and now deprecated `csi-lvm-sc-linear`, ... storageclasses, set helm-chart value `compat03x=true`.\n\n## Migration ##\n\nIf you want to migrate your existing PVC to / from csi-driver-lvm, you can use [korb](https://github.com/BeryJu/korb).\n\n### Todo ###\n\n* implement CreateSnapshot(), ListSnapshots(), DeleteSnapshot()\n\n\n### Test ###\n\n```bash\nkubectl apply -f examples/csi-pvc-raw.yaml\nkubectl apply -f examples/csi-pod-raw.yaml\n\n\nkubectl apply -f examples/csi-pvc.yaml\nkubectl apply -f examples/csi-app.yaml\n\nkubectl delete -f examples/csi-pod-raw.yaml\nkubectl delete -f examples/csi-pvc-raw.yaml\n\nkubectl delete -f  examples/csi-app.yaml\nkubectl delete -f examples/csi-pvc.yaml\n```\n\n### Development ###\n\nIn order to run the integration tests locally, you need to create to loop devices on your host machine. Make sure the loop device mount paths are not used on your system (default path is `/dev/loop10{0,1}`).\n\nYou can create these loop devices like this:\n\n```bash\nfor i in 100 101; do fallocate -l 1G loop${i}.img ; sudo losetup /dev/loop${i} loop${i}.img; done\nsudo losetup -a\n# https://github.com/util-linux/util-linux/issues/3197\n# use this for recreation or cleanup\n# for i in 100 101; do sudo losetup -d /dev/loop${i}; rm -f loop${i}.img; done\n```\n\nYou can then run the tests against a kind cluster, running:\n\n```bash\nmake test\n```\n\nTo recreate or cleanup the kind cluster:\n\n```bash\nmake test-cleanup\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetal-stack%2Fcsi-driver-lvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetal-stack%2Fcsi-driver-lvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetal-stack%2Fcsi-driver-lvm/lists"}