{"id":25000551,"url":"https://github.com/gluster/gluster-csi-driver","last_synced_at":"2025-04-12T08:52:24.431Z","repository":{"id":57521930,"uuid":"117171629","full_name":"gluster/gluster-csi-driver","owner":"gluster","description":"DEPRECATED: Gluster Container Storage Interface (CSI) driver","archived":false,"fork":false,"pushed_at":"2023-09-06T06:54:02.000Z","size":389,"stargazers_count":59,"open_issues_count":33,"forks_count":32,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-12T08:52:17.826Z","etag":null,"topics":["csi","gluster","kubernetes","kubernetes-storage"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gluster.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING-LGPLV3","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-12T00:42:24.000Z","updated_at":"2025-04-03T03:46:56.000Z","dependencies_parsed_at":"2024-01-14T08:30:27.746Z","dependency_job_id":"2610ea37-7ea4-46fe-aef9-ccc73b3d9e77","html_url":"https://github.com/gluster/gluster-csi-driver","commit_stats":null,"previous_names":["gluster/glusterfs-csi-driver"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gluster%2Fgluster-csi-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gluster%2Fgluster-csi-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gluster%2Fgluster-csi-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gluster%2Fgluster-csi-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gluster","download_url":"https://codeload.github.com/gluster/gluster-csi-driver/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248543883,"owners_count":21121838,"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","gluster","kubernetes","kubernetes-storage"],"created_at":"2025-02-04T19:35:44.222Z","updated_at":"2025-04-12T08:52:24.412Z","avatar_url":"https://github.com/gluster.png","language":"Go","funding_links":[],"categories":["Roadmap"],"sub_categories":["[Tutorials](#tutorials)"],"readme":"# gluster-csi-driver\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/gluster/gluster-csi-driver)](https://goreportcard.com/report/github.com/gluster/gluster-csi-driver)\n[![Build Status](https://ci.centos.org/view/Gluster/job/gluster_csi-driver-master/badge/icon)](https://ci.centos.org/view/Gluster/job/gluster_csi-driver-master/)\n\nThis repo contains CSI driver for Gluster. The Container Storage Interface\n(CSI) is a proposed new industry standard for cluster-wide volume plugins.\n“Container Storage Interface” (CSI)  enables storage vendors (SP) to develop a\nplugin once and have it work across a number of container orchestration (CO)\nsystems.\n\n## Demo of GlusterFS CSI driver to create and delete volumes on GD2 Cluster\n\n[![GlusterFS CSI driver Demo](https://asciinema.org/a/195024.png)](https://asciinema.org/a/195024)\n\n## Building GlusterFS CSI driver\n\nThis repository contains the source and a Dockerfile to build the GlusterFS CSI\ndriver. The driver is built as a multi-stage container build. This requires a\nrelatively recent version of Docker or Buildah.\n\nDocker packages can be obtained for\n[CentOS](https://docs.docker.com/install/linux/docker-ce/centos/),\n[Fedora](https://docs.docker.com/install/linux/docker-ce/fedora/) or other\ndistributions.\n\nTo build, ensure docker is installed, and run:\n\n1. Get inside the repository directory\n\n```\n[root@localhost]# cd gluster-csi-driver\n```\n\n1. Build the glusterfs-csi-driver container\n\n```\n[root@localhost]# ./build.sh\n```\n\n## Testing GlusterFS CSI driver\n\n### Deploy kubernetes Cluster\n\n### Deploy a GD2 gluster cluster\n\n### Create a glusterfs storage class (RWX)\n\n```\n[root@localhost]# cat storage-class.yaml\napiVersion: storage.k8s.io/v1\nkind: StorageClass\nmetadata:\n  name: glusterfs-csi\n  annotations:\n    storageclass.kubernetes.io/is-default-class: \"true\"\nprovisioner: org.gluster.glusterfs\n```\n\n```\n[root@localhost]# kubectl create -f storage-class.yaml\nstorageclass.storage.k8s.io/glusterfs-csi created\n```\n\nVerify glusterfs storage class (RWX)\n\n```\n[root@localhost]# kubectl get storageclass\nNAME                      PROVISIONER             AGE\nglusterfs-csi (default)   org.gluster.glusterfs   105s\n[root@localhost]# kubectl describe storageclass/glusterfs-csi\nName:                  glusterfs-csi\nIsDefaultClass:        Yes\nAnnotations:           storageclass.kubernetes.io/is-default-class=true\nProvisioner:           org.gluster.glusterfs\nParameters:            \u003cnone\u003e\nAllowVolumeExpansion:  \u003cunset\u003e\nMountOptions:          \u003cnone\u003e\nReclaimPolicy:         Delete\nVolumeBindingMode:     Immediate\nEvents:                \u003cnone\u003e\n```\n\n### Create RWX PersistentVolumeClaim\n\n```\n[root@localhost]# cat pvc.yaml\n---\nkind: PersistentVolumeClaim\napiVersion: v1\nmetadata:\n  name: glusterfs-csi-pv\nspec:\n  storageClassName: glusterfs-csi\n  accessModes:\n  - ReadWriteMany\n  resources:\n    requests:\n      storage: 5Gi\n\n[root@localhost]# kubectl create -f pvc.yaml\npersistentvolumeclaim/glusterfs-csi-pv created\n```\n\nValidate the RWX claim creation\n\n```\n[root@localhost]# kubectl get pvc\nNAME      STATUS    VOLUME                                                        CAPACITY   ACCESS MODES   STORAGECLASS   AGE\nglusterfs-csi-pv   Bound     pvc-953d21f5a51311e8   5Gi        RWX            glusterfs-csi   3s\n```\n\n```\n[root@localhost]# kubectl describe pvc\nName:          glusterfs-csi-pv\nNamespace:     default\nStorageClass:  glusterfs-csi\nStatus:        Bound\nVolume:        pvc-953d21f5a51311e8\nLabels:        \u003cnone\u003e\nAnnotations:   control-plane.alpha.kubernetes.io/leader={\"holderIdentity\":\"874a6cc9-a511-11e8-bae2-0a580af40202\",\"leaseDurationSeconds\":15,\"acquireTime\":\"2018-08-21T07:26:58Z\",\"renewTime\":\"2018-08-21T07:27:00Z\",\"lea...\n               pv.kubernetes.io/bind-completed=yes\n               pv.kubernetes.io/bound-by-controller=yes\n               storageClassName=glusterfs-csi\n               volume.kubernetes.io/storage-provisioner=org.gluster.glusterfs\nFinalizers:    [kubernetes.io/pvc-protection]\nCapacity:      5Gi\nAccess Modes:  RWX\nEvents:\n  Type    Reason                 Age                From                                                                                          Message\n  ----    ------                 ----               ----                                                                                          -------\n  Normal  ExternalProvisioning   30s (x2 over 30s)  persistentvolume-controller                                                                   waiting for a volume to be created, either by external provisioner \"org.gluster.glusterfs\" or manually created by system administrator\n  Normal  Provisioning           30s                org.gluster.glusterfs csi-provisioner-glusterfsplugin-0 874a6cc9-a511-11e8-bae2-0a580af40202  External provisioner is provisioning volume for claim \"default/glusterfs-csi-pv\"\n  Normal  ProvisioningSucceeded  29s                org.gluster.glusterfs csi-provisioner-glusterfsplugin-0 874a6cc9-a511-11e8-bae2-0a580af40202  Successfully provisioned volume pvc-953d21f5a51311e8\n```\n\nVerify PV details:\n\n```\n[root@localhost]# kubectl describe pv\nName:            pvc-953d21f5a51311e8\nLabels:          \u003cnone\u003e\nAnnotations:     pv.kubernetes.io/provisioned-by=org.gluster.glusterfs\nFinalizers:      [kubernetes.io/pv-protection]\nStorageClass:    glusterfs-csi\nStatus:          Bound\nClaim:           default/glusterfs-csi-pv\nReclaim Policy:  Delete\nAccess Modes:    RWX\nCapacity:        5Gi\nNode Affinity:   \u003cnone\u003e\nMessage:\nSource:\n    Type:          CSI (a Container Storage Interface (CSI) volume source)\n    Driver:        org.gluster.glusterfs\n    VolumeHandle:  pvc-953d21f5a51311e8\n    ReadOnly:      false\nEvents:            \u003cnone\u003e\n```\n\n### Create a pod with RWX pvc claim\n\n```\n[root@localhost]# cat app.yaml\n---\napiVersion: v1\nkind: Pod\nmetadata:\n  name: gluster\n  labels:\n    name: gluster\nspec:\n  containers:\n  - name: gluster\n    image: redis\n    imagePullPolicy: IfNotPresent\n    volumeMounts:\n    - mountPath: \"/mnt/gluster\"\n      name: glustercsivol\n  volumes:\n  - name: glustercsivol\n    persistentVolumeClaim:\n      claimName: glusterfs-csi-pv\n\n[root@localhost]# kubectl create -f app.yaml\n```\n\nCheck mount output and validate.\n\n```\n[root@localhost]# mount |grep glusterfs\n192.168.121.158:pvc-953d21f5a51311e8 on /var/lib/kubelet/pods/2a563343-a514-11e8-a324-525400a04cb4/volumes/kubernetes.io~csi/pvc-953d21f5a51311e8/mount type fuse.glusterfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,max_read=131072)\n\n[root@localhost]# kubectl delete pod gluster\npod \"gluster\" deleted\n[root@localhost]# mount |grep glusterfs\n[root@localhost]#\n```\n\n### Support for Snapshot\n\nKubernetes v1.12 introduces alpha support for volume snapshotting.\nThis feature allows creating/deleting volume snapshots, and the ability\nto create new volumes from a snapshot natively using the Kubernetes API.\n\nTo verify clone functionality work as intended,\nlets start with writing some data into already created application with PVC.\n\n```\n[root@localhost]# kubectl exec -it redis /bin/bash\nroot@redis:/data# cd /mnt/gluster/\nroot@redis:/mnt/gluster# echo \"glusterfs csi clone test\" \u003e clone_data\n```\n\n### Create a snapshot class\n\n```\n[root@localhost]# cat snapshot-class.yaml\n---\napiVersion: snapshot.storage.k8s.io/v1alpha1\nkind: VolumeSnapshotClass\nmetadata:\n  name: glusterfs-csi-snap\nsnapshotter: org.gluster.glusterfs\n```\n\n```\n[root@localhost]# kubectl create -f snapshot-class.yaml\nvolumesnapshotclass.snapshot.storage.k8s.io/glusterfs-csi-snap created\n```\n\nVerify snapshot class\n\n```\n[root@localhost]# kubectl get volumesnapshotclass\nNAME               AGE\nglusterfs-csi-snap   1h\n[root@localhost]# kubectl describe volumesnapshotclass/glusterfs-csi-snap\nName:         glusterfs-csi-snap\nNamespace:\nLabels:       \u003cnone\u003e\nAnnotations:  \u003cnone\u003e\nAPI Version:  snapshot.storage.k8s.io/v1alpha1\nKind:         VolumeSnapshotClass\nMetadata:\n  Creation Timestamp:  2018-10-24T04:57:34Z\n  Generation:          1\n  Resource Version:    3215\n  Self Link:           /apis/snapshot.storage.k8s.io/v1alpha1/volumesnapshotclasses/glusterfs-csi-snap\n  UID:                 51de83df-d749-11e8-892a-525400d84c47\nSnapshotter:           org.gluster.glusterfs\nEvents:                \u003cnone\u003e\n```\n\n### Create a snapshot from RWX pvc\n\n```\n[root@localhost]# cat volume-snapshot.yaml\n---\napiVersion: snapshot.storage.k8s.io/v1alpha1\nkind: VolumeSnapshot\nmetadata:\n  name: glusterfs-csi-ss\nspec:\n  snapshotClassName: glusterfs-csi-ss\n  source:\n    name: glusterfs-csi-pv\n    kind: PersistentVolumeClaim\n\n```\n\n```\n[root@localhost]# kubectl create -f volume-snapshot.yaml\nvolumesnapshot.snapshot.storage.k8s.io/glusterfs-csi-ss created\n```\n\nVerify volume snapshot\n\n```\n[root@localhost]# kubectl get volumesnapshot\nNAME               AGE\nglusterfs-csi-ss   13s\n[root@localhost]# kubectl describe volumesnapshot/glusterfs-csi-ss\nName:         glusterfs-csi-ss\nNamespace:    default\nLabels:       \u003cnone\u003e\nAnnotations:  \u003cnone\u003e\nAPI Version:  snapshot.storage.k8s.io/v1alpha1\nKind:         VolumeSnapshot\nMetadata:\n  Creation Timestamp:  2018-10-24T06:39:35Z\n  Generation:          1\n  Resource Version:    12567\n  Self Link:           /apis/snapshot.storage.k8s.io/v1alpha1/namespaces/default/volumesnapshots/glusterfs-csi-ss\n  UID:                 929722b7-d757-11e8-892a-525400d84c47\nSpec:\n  Snapshot Class Name:    glusterfs-csi-snap\n  Snapshot Content Name:  snapcontent-929722b7-d757-11e8-892a-525400d84c47\n  Source:\n    Kind:  PersistentVolumeClaim\n    Name:  glusterfs-csi-pv\nStatus:\n  Creation Time:  1970-01-01T00:00:01Z\n  Ready:          true\n  Restore Size:   \u003cnil\u003e\nEvents:           \u003cnone\u003e\n```\n\n### Provision new volume from snapshot\n\n```\n[root@localhost]# cat pvc-restore.yaml\n---\napiVersion: v1\nkind: PersistentVolumeClaim\nmetadata:\n  name: glusterfs-pv-restore\nspec:\n  storageClassName: glusterfs-csi\n  dataSource:\n    name: glusterfs-csi-ss\n    kind: VolumeSnapshot\n    apiGroup: snapshot.storage.k8s.io\n  accessModes:\n    - ReadWriteMany\n  resources:\n    requests:\n      storage: 5Gi\n```\n\n```\n[root@localhost]# kubectl create -f pvc-restore.yaml\npersistentvolumeclaim/glusterfs-pv-restore created\n```\n\nVerify newly created claim\n\n```\n[root@localhost]# kubectl get pvc\nNAME                   STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS    AGE\nglusterfs-csi-pv       Bound    pvc-712278b0-d749-11e8-892a-525400d84c47   5Gi        RWX            glusterfs-csi   103m\nglusterfs-pv-restore   Bound    pvc-dfcc36f0-d757-11e8-892a-525400d84c47   5Gi        RWO            glusterfs-csi   14s\n```\n\n```\n[root@localhost]# kubectl describe pvc/glusterfs-pv-restore\nName:          glusterfs-pv-restore\nNamespace:     default\nStorageClass:  glusterfs-csi\nStatus:        Bound\nVolume:        pvc-dfcc36f0-d757-11e8-892a-525400d84c47\nLabels:        \u003cnone\u003e\nAnnotations:   pv.kubernetes.io/bind-completed: yes\n               pv.kubernetes.io/bound-by-controller: yes\n               volume.kubernetes.io/storage-provisioner: org.gluster.glusterfs\nFinalizers:    [kubernetes.io/pvc-protection]\nCapacity:      5Gi\nAccess Modes:  RWO\nEvents:\n  Type       Reason                 Age   From                                                                                          Message\n  ----       ------                 ----  ----                                                                                          -------\n  Normal     ExternalProvisioning   41s   persistentvolume-controller                                                                   waiting for a volume to be created, either by external provisioner \"org.gluster.glusterfs\" or manually created by system administrator\n  Normal     Provisioning           41s   org.gluster.glusterfs_csi-provisioner-glusterfsplugin-0_1e7821cb-d749-11e8-9935-0a580af40303  External provisioner is provisioning volume for claim \"default/glusterfs-pv-restore\"\n  Normal     ProvisioningSucceeded  41s   org.gluster.glusterfs_csi-provisioner-glusterfsplugin-0_1e7821cb-d749-11e8-9935-0a580af40303  Successfully provisioned volume pvc-dfcc36f0-d757-11e8-892a-525400d84c47\nMounted By:  \u003cnone\u003e\n```\n\n### Create an app with New claim\n\n```\n[root@localhost]# cat app-with-clone.yaml\n---\napiVersion: v1\nkind: Pod\nmetadata:\n  name: redis-pvc-restore\n  labels:\n    name: redis-pvc-restore\nspec:\n  containers:\n    - name: redis-pvc-restore\n      image: redis:latest\n      imagePullPolicy: IfNotPresent\n      volumeMounts:\n        - mountPath: \"/mnt/gluster\"\n          name: glusterfscsivol\n  volumes:\n    - name: glusterfscsivol\n      persistentVolumeClaim:\n        claimName: glusterfs-pv-restore\n```\n\n```\n[root@localhost]# kubectl create -f app-with-clone.yaml\npod/redis-pvc-restore created\n```\n\nVerify cloned data is present in newly created application\n\n```\n[root@localhost]# kubectl get po\nNAME                                   READY   STATUS    RESTARTS   AGE\ncsi-attacher-glusterfsplugin-0         2/2     Running   0          112m\ncsi-nodeplugin-glusterfsplugin-dl7pp   2/2     Running   0          112m\ncsi-nodeplugin-glusterfsplugin-khrtd   2/2     Running   0          112m\ncsi-nodeplugin-glusterfsplugin-kqcsw   2/2     Running   0          112m\ncsi-provisioner-glusterfsplugin-0      3/3     Running   0          112m\nglusterfs-55v7v                        1/1     Running   0          128m\nglusterfs-qbvgv                        1/1     Running   0          128m\nglusterfs-vclr4                        1/1     Running   0          128m\nredis                                  1/1     Running   0          109m\nredis-pvc-restore                      1/1     Running   0          26s\n[root@localhost]# kubectl exec -it redis-pvc-restore /bin/bash\nroot@redis-pvc-restore:/data# cd /mnt/gluster/\nroot@redis-pvc-restore:/mnt/gluster# ls\nclone_data\nroot@redis-pvc-restore:/mnt/gluster# cat clone_data\nglusterfs csi clone test\n```\n\n### Create a glusterfs lite storage class to use loopback bricks (RWX)\n\n```\n[root@localhost]# cat glusterfs-lite-storage-class.yaml\napiVersion: storage.k8s.io/v1\nkind: StorageClass\nmetadata:\n  name: glusterfs-lite-csi\nprovisioner: org.gluster.glusterfs\nparameters:\n  brickType: \"loop\"\n```\n\n```\n[root@localhost]# kubectl create -f glusterfs-lite-storage-class.yaml\nstorageclass.storage.k8s.io/glusterfs-lite-csi created\n```\n\nVerify glusterfs storage class (RWX)\n\n```\n[root@localhost]# kubectl get storageclass\nNAME                      PROVISIONER             AGE\nglusterfs-lite-csi        org.gluster.glusterfs   105s\n```\n\n### Create RWX PersistentVolumeClaim using glusterfs-lite-csi storage class\n\n```\n[root@localhost]# cat pvc.yaml\n---\nkind: PersistentVolumeClaim\napiVersion: v1\nmetadata:\n  name: glusterfs-lite-csi-pv\nspec:\n  storageClassName: glusterfs-lite-csi\n  accessModes:\n  - ReadWriteMany\n  resources:\n    requests:\n      storage: 5Gi\n\n[root@localhost]# kubectl create -f pvc.yaml\npersistentvolumeclaim/glusterfs-lite-csi-pv created\n```\n\nValidate the RWX claim creation\n\n```\n[root@localhost]# kubectl get pvc\nNAME                    STATUS    VOLUME                 CAPACITY   ACCESS MODES   STORAGECLASS         AGE\nglusterfs-lite-csi-pv   Bound     pvc-943d21f5a51312e7   5Gi        RWX            glusterfs-lite-csi   5s\n```\n\n#### Create PVC with thin arbiter support\n\nfollow [guide](\n  https://docs.gluster.org/en/latest/Administrator%20Guide/Thin-Arbiter-Volumes/)\nto setup thin arbiter\n\n### Create Thin-Arbiter storage class\n\n```\n$ cat thin-arbiter-storageclass.yaml\n---\napiVersion: storage.k8s.io/v1\nkind: StorageClass\nmetadata:\n  name: glusterfs-csi-thin-arbiter\nprovisioner: org.gluster.glusterfs\nparameters:\n  arbiterType: \"thin\"\n  arbiterPath: \"192.168.10.90:24007/mnt/arbiter-path\"\n```\n\n```\n$ kubectl create -f thin-arbiter-storageclass.yaml\nstorageclass.storage.k8s.io/glusterfs-csi-thin-arbiter created\n```\n\n### Create Thin-Arbiter PersistentVolumeClaim\n\n```\n$ cat thin-arbiter-pvc.yaml\n---\nkind: PersistentVolumeClaim\napiVersion: v1\nmetadata:\n  name: glusterfs-csi-thin-pv\nspec:\n  storageClassName: glusterfs-csi-thin-arbiter\n  accessModes:\n    - ReadWriteMany\n  resources:\n    requests:\n      storage: 5Gi\n```\n\n```\n$ kube create -f thin-arbiter-pvc.yaml\npersistentvolumeclaim/glusterfs-csi-thin-pv created\n```\n\nVerify PVC is in Bound state\n\n```\n$ kube get pvc\nNAME                     STATUS        VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS            AGE\nglusterfs-csi-thin-pv    Bound         pvc-86b3b70b-1fa0-11e9-9232-525400ea010d   5Gi        RWX            glusterfs-csi-arbiter   13m\n\n```\n\n### Create an app with claim\n\n```\n$ cat thin-arbiter-pod.yaml\n---\napiVersion: v1\nkind: Pod\nmetadata:\n  name: ta-redis\n  labels:\n    name: redis\nspec:\n  containers:\n    - name: redis\n      image: redis\n      imagePullPolicy: IfNotPresent\n      volumeMounts:\n        - mountPath: \"/mnt/gluster\"\n          name: glusterfscsivol\n  volumes:\n    - name: glusterfscsivol\n      persistentVolumeClaim:\n        claimName: glusterfs-csi-thin-pv\n```\n\n```\n$ kube create -f thin-arbiter-pod.yaml\npod/ta-redis created\n```\n\nVerify app is in running state\n\n```\n$ kube get po\nNAME        READY   STATUS        RESTARTS   AGE\nta-redis    1/1     Running       0          6m54s\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgluster%2Fgluster-csi-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgluster%2Fgluster-csi-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgluster%2Fgluster-csi-driver/lists"}