{"id":18992957,"url":"https://github.com/bakins/zfs-flex-volume","last_synced_at":"2026-03-02T03:35:34.048Z","repository":{"id":57607991,"uuid":"77558591","full_name":"bakins/zfs-flex-volume","owner":"bakins","description":"Simple ZFS flexVolume driver for Kubernetes","archived":false,"fork":false,"pushed_at":"2017-03-30T20:37:06.000Z","size":179,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-21T16:46:27.807Z","etag":null,"topics":["kubernetes","zfs","zfsonlinux"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bakins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-28T20:12:31.000Z","updated_at":"2019-04-14T18:38:26.000Z","dependencies_parsed_at":"2022-09-03T03:03:12.706Z","dependency_job_id":null,"html_url":"https://github.com/bakins/zfs-flex-volume","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/bakins/zfs-flex-volume","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakins%2Fzfs-flex-volume","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakins%2Fzfs-flex-volume/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakins%2Fzfs-flex-volume/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakins%2Fzfs-flex-volume/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bakins","download_url":"https://codeload.github.com/bakins/zfs-flex-volume/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakins%2Fzfs-flex-volume/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29991886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T01:47:34.672Z","status":"online","status_checked_at":"2026-03-02T02:00:07.342Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["kubernetes","zfs","zfsonlinux"],"created_at":"2024-11-08T17:19:24.779Z","updated_at":"2026-03-02T03:35:34.024Z","avatar_url":"https://github.com/bakins.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"zfs-flex-volume\n===============\n\nSimple ZFS [flexVolume](http://kubernetes.io/docs/user-guide/volumes/#flexvolume)\ndriver for Kubernetes.\n\nStatus\n======\n\nHighly experimental. Master is probably broken. Do not use on a system that you\ncare about the data.  This is currently just a port of the [lvm driver](https://github.com/kubernetes/kubernetes/blob/master/examples/volumes/flexvolume/lvm) to ZFS and Go. The code is fairly rough.\n\nLinux only.\n\n[Kubernetes FlexVolumes](https://github.com/kubernetes/kubernetes/blob/master/examples/volumes/flexvolume/README.md)\nare still considered _alpha_.\n\nDescription\n============\n\nFlexVolumes allow one to add support for additional storage backends to Kubernetes\nwithout modifying the core Kubernetes code.\n\nzfs-flex-volume provides a simplistic ZFS driver. It will allocate zfs filesystems\nfrom a parent dataset and mount them for usage in a container.\n\nBuilding\n========\n\nNote: tagged releases are availible at https://github.com/bakins/zfs-flex-volume/releases\n\nYou need a go build environment. This has been tested with go 1.7.x - other versions\nmay work.\n\nInside the repo, run `./script/build` and you should have a Linux amd64 binary\nnamed `zfs-flex-volume` in the root of the repo.\n\nUsage\n=====\n\nPlace the `zfs-flex-volume` binary on the target node(s).  You may want to place\nthis in your PATH to ease usage.  The node must have [ZFS](http://zfsonlinux.org/)\ninstalled and configured.\n\nCreate a \"parent\" dataset. All volumes created by this driver will be children\nof it. In my test set up, I have a zpool called `rpool` and I created a parent\nfilesystem like `zfs create -o mountpoint=/k8s-volumes,compression=lz4 rpool/k8s-volumes`.\n\nYou should create a shell wrapper script to pass this parent volume as an argument.\nUnder Kubernetes, there is no facility for doing this and as an administrator, you\nmay not wish to directly expose this.\n\nAn example wrapper script:\n\n```\n#!/bin/bash\nexec /usr/local/sbin/zfs-flex-volume -parent=rpool/k8s-volumes \"$@\"\n```\n\nKubernetes\n----------\n* Create the directory `/usr/libexec/kubernetes/kubelet-plugins/volume/exec/akins.org~zfs/`\n* Create/copy the shell wrapper script from above to `/usr/libexec/kubernetes/kubelet-plugins/volume/exec/akins.org~zfs/zfs`\n\nTo create a ZFS, create a [Kubernetes pod](http://kubernetes.io/docs/user-guide/pods/) such as:\n\n```yaml\napiVersion: v1\nkind: Pod\nmetadata:\n  name: nginx\nspec:\n  containers:\n  - name: nginx\n    image: nginx\n    volumeMounts:\n    - name: test\n      mountPath: /data\n    ports:\n    - containerPort: 80\n  volumes:\n  - name: test\n    flexVolume:\n      driver: \"akins.org/zfs\"\n      options:\n        dataset: \"test-volume\"\n        quota: \"1G\"\n```\n\nAnd the driver will create a volume  -- `rpool/k8s-volumes/test-volume` in our\nexample.\nThe volume will be mounted under the parent - `/k8s-volumes/test-volume` in our\nexample.\nThe volume will also be mounted in the container as `/data` inside the container.\nThe actual path on the host system is under `/var/lib/kubelet`, by default.\n\nWhen the pods is deleted, the volume will be unmounted from under `/var/lib/kubelet`,\nbut remained mounted under the parent dataset.  zfs-flex-driver, at this time, does\n**not** destroy the filesystem.\n\nNote: multiple pods may mount the same dataset on the same host.\n\nThe following options may be passed:\n* dataset - **required** - name of the dataset to create.\n* quota - **required** - [Quota](https://www.freebsd.org/doc/handbook/zfs-term.html#zfs-term-quota) for the dataset.\n* reservation - [reservation](https://www.freebsd.org/doc/handbook/zfs-term.html#zfs-term-reservation) for the dataset. By default, none is set.\n* compression - [compression](https://www.freebsd.org/doc/handbook/zfs-term.html#zfs-term-compression). By default no option is set, which means inherit from parent dataset.\n\nNote: the options are only used at **initial creation**. Changing the options will not\nchange the dataset.\n\nSee Also\n========\n* https://github.com/kubernetes/kubernetes/blob/master/examples/volumes/flexvolume/lvm\n* https://www.diamanti.com/blog/flexvolume-explored/\n\nLICENSE\n=======\nsee [LICENSE](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbakins%2Fzfs-flex-volume","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbakins%2Fzfs-flex-volume","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbakins%2Fzfs-flex-volume/lists"}