{"id":18293053,"url":"https://github.com/kubesphere/nfs-pv-static-provisioner","last_synced_at":"2025-04-09T08:13:50.261Z","repository":{"id":256344660,"uuid":"854353110","full_name":"kubesphere/nfs-pv-static-provisioner","owner":"kubesphere","description":"A NFS persistent volume static provisioner","archived":false,"fork":false,"pushed_at":"2024-11-26T09:50:15.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T19:15:48.634Z","etag":null,"topics":["nfs","provisioner","volume"],"latest_commit_sha":null,"homepage":"https://github.com/kubesphere/nfs-pv-static-provisioner","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kubesphere.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-09-09T02:35:28.000Z","updated_at":"2024-11-22T09:55:26.000Z","dependencies_parsed_at":"2024-10-20T10:02:26.200Z","dependency_job_id":null,"html_url":"https://github.com/kubesphere/nfs-pv-static-provisioner","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"52914b117d4135b338b917d1707bb2b3001021f8"},"previous_names":["kubesphere/nfs-pv-static-provisioner"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubesphere%2Fnfs-pv-static-provisioner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubesphere%2Fnfs-pv-static-provisioner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubesphere%2Fnfs-pv-static-provisioner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubesphere%2Fnfs-pv-static-provisioner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kubesphere","download_url":"https://codeload.github.com/kubesphere/nfs-pv-static-provisioner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247558698,"owners_count":20958206,"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":["nfs","provisioner","volume"],"created_at":"2024-11-05T14:21:35.121Z","updated_at":"2025-04-09T08:13:50.245Z","avatar_url":"https://github.com/kubesphere.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nfs-pv-static-provisioner\nA NFS persistent volume static provisioner, which allows you to quickly bind an existing NFS volume to PVC. \n\n**This provisioner will NOT provision volumes on NFS server when you create a PVC.** If you are looking for a dynamic provisioner of NFS, please consider other projects, like [this](https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner).\n\n## Description\nThe provisioner listens PVC CREATE and UPDATE events, when the PVC has demanded annotations, the provisioner will create/update a NFS PV and bind it with the PVC automatically.\n\n| Annotation                                 | Required | Default Value        | Explanation                                                  | Example Values                          |\n|--------------------------------------------|----------|----------------------|--------------------------------------------------------------|-----------------------------------------|\n| storage.kubesphere.io/nfs-static-provision | Y        | \"false\"              | must set to \"true\" in order to use this provisioner          | \"true\"                                  |\n| storage.kubesphere.io/nfs-server           | Y        | \"\"                   | nfs server hostname or IP address (PV.spec.nfs.server)       | \"example.nfs.server.com\", \"192.168.0.5\" |\n| storage.kubesphere.io/nfs-path             | Y        | \"\"                   | nfs volume absolute path (PV.spec.nfs.path)                  | \"/exports/volume1\"                      |\n| storage.kubesphere.io/nfs-readonly         | N        | \"false\"              | whether the volume is read-only (PV.spec.nfs.readOnly)       | \"false\", \"true\"                         |\n| storage.kubesphere.io/reclaim-policy*      | N        | \"Delete\"             | reclaim policy of PV (PV.spec.persistentVolumeReclaimPolicy) | \"Delete\", \"Retain\"                      |\n| storage.kubesphere.io/mount-options        | N        | \"\"                   | mount options of PV (PV.spec.mountOptions)                   | `\"[\\\"nfsvers=3\\\",\\\"nolock\\\",\\\"hard\\\"]\"` |\n| storage.kubesphere.io/pv-name              | N        | \"pvc-${random uuid}\" | PV name                                                      | \"nfs-pv-1\"                              |\n\n- *When reclaim policy is \"Delete\", the PV will be deleted when the PVC is deleted. However, this only affects the PV resource in k8s cluster, the real backend volume on NFS server still exists.\n\n## Usecase\n- As a tenant(e.g. admin of a namespace) on kubernetes cluster, you don't have permissions to create PV resources (as PV is cluster-level resource), but you own an external NFS server and want to use the existing volumes via PVC.\n\n## Deploy\n### Deploy\nTo deploy the controller:\n```sh\nmake deploy\n```\n\n### Test\nCreate a PVC and check if it can be automatically bound. Take [this](./config/samples/pvc.yaml) for example.\n\n### Undeploy\nTo uninstall the controller:\n```sh\nmake undeploy\n```\n\n## Events\nPV create/update events will be issued targeting the PVC object.\n\ne.g.\n```sh\n$ kubectl describe pvc pvc-nfs\nName:          pvc-nfs\nNamespace:     default\nStorageClass:\nStatus:        Pending\nVolume:        pvc-f6c5a1c9-cbfc-4994-8079-956024db8e52\nLabels:        \u003cnone\u003e\nAnnotations:   storage.kubesphere.io/nfs-path: aaa\n               storage.kubesphere.io/nfs-server: test.nfs.server.com\n               storage.kubesphere.io/nfs-static-provision: true\nFinalizers:    [kubernetes.io/pvc-protection]\nCapacity:      0\nAccess Modes:\nVolumeMode:    Filesystem\nUsed By:       \u003cnone\u003e\nEvents:\n  Type     Reason             Age               From                         Message\n  ----     ------             ----              ----                         -------\n  Normal   FailedBinding      9s                persistentvolume-controller  no persistent volumes available for this claim and no storage class is set\n  Normal   VolumeNameUpdated  9s                nfs-pv-static-provisioner    volumeName updated successfully\n  Warning  CreatePVFailed     4s (x11 over 9s)  nfs-pv-static-provisioner    failed to create pv pvc-f6c5a1c9-cbfc-4994-8079-956024db8e52, error: PersistentVolume \"pvc-f6c5a1c9-cbfc-4994-8079-956024db8e52\" is invalid: spec.nfs.path: Invalid value: \"aaa\": must be an absolute path\n```\n\n```sh\n$ kubectl describe pvc pvc-nfs\nName:          pvc-nfs\nNamespace:     default\nStorageClass:\nStatus:        Bound\nVolume:        pvc-f6f9747e-3479-4664-a32f-268b2c62f0bd\nLabels:        \u003cnone\u003e\nAnnotations:   pv.kubernetes.io/bind-completed: yes\n               storage.kubesphere.io/nfs-path: /a/b\n               storage.kubesphere.io/nfs-server: test.nfs.server.com\n               storage.kubesphere.io/nfs-static-provision: true\nFinalizers:    [kubernetes.io/pvc-protection]\nCapacity:      1Gi\nAccess Modes:  RWX\nVolumeMode:    Filesystem\nUsed By:       \u003cnone\u003e\nEvents:\n  Type    Reason             Age   From                         Message\n  ----    ------             ----  ----                         -------\n  Normal  FailedBinding      12s   persistentvolume-controller  no persistent volumes available for this claim and no storage class is set\n  Normal  VolumeNameUpdated  12s   nfs-pv-static-provisioner    volumeName updated successfully\n  Normal  PVCreated          12s   nfs-pv-static-provisioner    pv pvc-f6f9747e-3479-4664-a32f-268b2c62f0bd created successfully\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubesphere%2Fnfs-pv-static-provisioner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkubesphere%2Fnfs-pv-static-provisioner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubesphere%2Fnfs-pv-static-provisioner/lists"}